Skip to content

Commit

Permalink
fix: check if column already exists before adding it
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloiankoski committed Jan 15, 2025
1 parent 45c6a36 commit ec261ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit ec261ca

Please sign in to comment.