[
  {
    "type": "alter_table",
    "description": "Fix regression from 20260414_002: flip timeOffMaxFutureDays default from 365 to 0 (unlimited). Previous default silently capped every existing store at 1 year, blocking otherwise-valid long-future requests.",
    "database": "kiosk_buykiosk",
    "check_query": "SELECT COLUMN_DEFAULT AS currentDefault FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'kiosk_buykiosk' AND TABLE_NAME = 'stores' AND COLUMN_NAME = 'timeOffMaxFutureDays'",
    "check_value": "365",
    "sql": "ALTER TABLE `stores` MODIFY COLUMN `timeOffMaxFutureDays` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Maximum days in the future a time-off request can be made (0 = unlimited)'"
  },
  {
    "type": "raw_sql",
    "description": "Reset existing stores still at the old 365 default back to 0 (unlimited). Safe because the time-off rules UI was introduced in the same batch and no admin has had the chance to intentionally set 365 yet.",
    "database": "kiosk_buykiosk",
    "check_query": "SELECT CASE WHEN EXISTS(SELECT 1 FROM stores WHERE timeOffMaxFutureDays = 365) THEN 1 ELSE 0 END AS needsUpdate",
    "check_value": 1,
    "sql": "UPDATE `stores` SET `timeOffMaxFutureDays` = 0 WHERE `timeOffMaxFutureDays` = 365"
  }
]
