[
  {
    "type": "alter_table",
    "description": "Flip embeddedChatEnabled default from 0 to 1 — workbook embedded chat is now on by default for every store; the legacy DataTable view is being retired and new stores should land on the Syncfusion grid + chat experience automatically.",
    "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 = 'embeddedChatEnabled'",
    "check_value": "0",
    "sql": "ALTER TABLE `stores` MODIFY COLUMN `embeddedChatEnabled` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'Feature flag: enable embedded SMS chat panel + Syncfusion completed-buys grid in workbook (default on)'"
  },
  {
    "type": "raw_sql",
    "description": "Backfill: enable embedded chat on every store still sitting at the original default of 0. As of 2026-05-06 this was 9 active stores, all pre-launch (no buys recorded yet). Stores already at 1 are unaffected.",
    "database": "kiosk_buykiosk",
    "check_query": "SELECT CASE WHEN EXISTS(SELECT 1 FROM stores WHERE embeddedChatEnabled = 0) THEN 1 ELSE 0 END AS needsUpdate",
    "check_value": 1,
    "sql": "UPDATE `stores` SET `embeddedChatEnabled` = 1 WHERE `embeddedChatEnabled` = 0"
  }
]
