[
  {
    "type": "alter_table",
    "description": "Add lastReadAt column to chat_threads for store-wide read tracking",
    "database": "{{store}}",
    "check_query": "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'chat_threads' AND COLUMN_NAME = 'lastReadAt'",
    "sql": "ALTER TABLE `chat_threads` ADD COLUMN `lastReadAt` timestamp NULL DEFAULT NULL COMMENT 'Store-wide last-read timestamp' AFTER `last_staff_message_at`"
  }
]
