-- schema version 36 to 37

UPDATE client_parameter SET value = '0' WHERE param = 'ENABLE_TIME_TRIGGERS';

-- fix old deliveries
UPDATE delivery         SET xtime = NULL, mtime = ctime WHERE year <= 2022 AND mtime >= 1768521600 AND mtime < 1772323200;
UPDATE delivery_part    SET xtime = NULL, mtime = ctime WHERE year <= 2022 AND mtime >= 1768521600 AND mtime < 1772323200;
-- clear xtime at one laptop to force updates from this one
UPDATE delivery         SET xtime = NULL WHERE year >= 2023 AND xtime >= 1771200000 AND xtime < 1771286400;
UPDATE delivery_part    SET xtime = NULL WHERE year >= 2023 AND xtime >= 1771200000 AND xtime < 1771286400;

UPDATE client_parameter SET value = '1' WHERE param = 'ENABLE_TIME_TRIGGERS';
