From ec261caa21858c7b4024c9e30e1a015a8149d28a Mon Sep 17 00:00:00 2001 From: Paulo Iankoski Date: Wed, 15 Jan 2025 16:34:47 -0300 Subject: [PATCH] fix: check if column already exists before adding it --- .../Migrations/AddAmountColumnToEventTicketsTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EventTickets/Migrations/AddAmountColumnToEventTicketsTable.php b/src/EventTickets/Migrations/AddAmountColumnToEventTicketsTable.php index b9542636a7..4e613e50ef 100644 --- a/src/EventTickets/Migrations/AddAmountColumnToEventTicketsTable.php +++ b/src/EventTickets/Migrations/AddAmountColumnToEventTicketsTable.php @@ -50,7 +50,7 @@ private function addAmountColumn($wpdb, $eventTicketsTable) { ADD COLUMN amount INT UNSIGNED NOT NULL AFTER donation_id"; try { - $wpdb->query($sql); + maybe_add_column($eventTicketsTable, 'amount', $sql); } catch (DatabaseQueryException $exception) { throw new DatabaseMigrationException( "An error occurred while adding the amount column to the $eventTicketsTable table", 0, $exception ); }