USE faunamix;

SET @has_payment_method := (
  SELECT COUNT(*) FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE()
    AND TABLE_NAME = 'reservation_requests'
    AND COLUMN_NAME = 'payment_method'
);
SET @sql_payment_method := IF(
  @has_payment_method = 0,
  "ALTER TABLE reservation_requests ADD COLUMN payment_method ENUM('not_selected','bank_transfer','credit_card','cash') NOT NULL DEFAULT 'not_selected' AFTER total_price_try",
  "ALTER TABLE reservation_requests MODIFY COLUMN payment_method ENUM('not_selected','bank_transfer','credit_card','cash') NOT NULL DEFAULT 'not_selected'"
);
PREPARE stmt FROM @sql_payment_method; EXECUTE stmt; DEALLOCATE PREPARE stmt;
