DeliveryScheduleAdminWindow: Add Attribute, Cultivation and IsCancelled
All checks were successful
Test / Run tests (push) Successful in 1m37s

This commit is contained in:
2024-09-16 09:54:03 +02:00
parent f09c43c1bd
commit d8a10152b3
8 changed files with 89 additions and 8 deletions

View File

@ -0,0 +1,23 @@
-- schema version 28 to 29
ALTER TABLE delivery_schedule ADD COLUMN attrid TEXT DEFAULT NULL;
ALTER TABLE delivery_schedule ADD COLUMN cultid TEXT DEFAULT NULL;
ALTER TABLE delivery_schedule ADD COLUMN cancelled INTEGER NOT NULL CHECK (cancelled IN (TRUE, FALSE)) DEFAULT FALSE;
UPDATE delivery_schedule SET cultid = 'B' WHERE UPPER(description) LIKE '%BIO%';
UPDATE delivery_schedule SET cancelled = TRUE WHERE zwstid = 'M' AND date IN ('2024-09-14', '2024-09-16');
PRAGMA writable_schema = ON;
UPDATE sqlite_schema SET sql = REPLACE(sql, '
) STRICT', ',
CONSTRAINT fk_delivery_schedule_wine_attribute FOREIGN KEY (attrid) REFERENCES wine_attribute (attrid)
ON UPDATE CASCADE
ON DELETE RESTRICT,
CONSTRAINT fk_delivery_schedule_wine_cultivation FOREIGN KEY (cultid) REFERENCES wine_cultivation (cultid)
ON UPDATE CASCADE
ON DELETE RESTRICT
) STRICT')
WHERE type = 'table' AND name = 'delivery_schedule';
PRAGMA schema_version = 2801;
PRAGMA writable_schema = OFF;