[
  {
    "type": "alter_table",
    "description": "Extend qb_sync_log.status ENUM to include the data-freshness states DataFreshnessHandler writes. The original ENUM ('pending','processing','success','failed','partial') was missing 'data_pending', 'data_missing', and 'resolved' — values that DataFreshnessHandler::createFreshnessRecord / updateFreshnessRecord / resolvePendingEntry have always written. Without strict_mode in MariaDB the writes silently truncate to '', and even with strict_mode they throw — both paths swallow the error in the defensive try/catch and freshness tracking goes dark. This ALTER aligns the schema with the code so the freshness lifecycle (data_pending → data_missing OR resolved) actually persists.",
    "database": "{{store}}",
    "check_query": "SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'qb_sync_log' AND COLUMN_NAME = 'status' AND COLUMN_TYPE LIKE '%data_missing%' AND COLUMN_TYPE LIKE '%data_pending%' AND COLUMN_TYPE LIKE '%resolved%'",
    "sql": "ALTER TABLE qb_sync_log MODIFY COLUMN status ENUM('pending','processing','success','failed','partial','data_pending','data_missing','resolved') NOT NULL DEFAULT 'pending'"
  }
]
