chore(booking): Bezahlt-Kennzeichen per Migration entfernen
Migration 011 droppt bookings.paid portabel (MySQL/MariaDB), damit Neuinstallationen ohne die Spalte nicht abbrechen.
This commit is contained in:
parent
11bb83c66c
commit
7c0a7c7cd4
2 changed files with 24 additions and 1 deletions
21
sql/migrations/011_booking_paid_entfernen.sql
Normal file
21
sql/migrations/011_booking_paid_entfernen.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- Rücknahme des Bezahlt-Kennzeichens (Migration 010).
|
||||
--
|
||||
-- Die Kundenrundmail wählt ihre Empfänger nicht mehr über ein Zahlungs-Flag,
|
||||
-- sondern über Buchungen der letzten 13 Monate, die nicht storniert sind.
|
||||
-- Das Feld wird daher wieder entfernt. Die Abfrage ist portabel (MySQL und
|
||||
-- MariaDB), damit Neuinstallationen ohne die Spalte nicht abbrechen.
|
||||
|
||||
SET @dic_sql = (
|
||||
SELECT IF(
|
||||
COUNT(*) > 0,
|
||||
'ALTER TABLE bookings DROP COLUMN paid',
|
||||
'DO 0'
|
||||
)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'bookings'
|
||||
AND COLUMN_NAME = 'paid'
|
||||
);
|
||||
PREPARE dic_stmt FROM @dic_sql;
|
||||
EXECUTE dic_stmt;
|
||||
DEALLOCATE PREPARE dic_stmt;
|
||||
Loading…
Add table
Add a link
Reference in a new issue