[
  {
    "type": "create_table",
    "description": "Create staff_chat_audit_log table for message edit/delete tracking (2 year retention)",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'staff_chat_audit_log'",
    "sql": "CREATE TABLE `staff_chat_audit_log` (\n  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n  `messageId` bigint(20) unsigned NOT NULL,\n  `action` enum('create','edit','delete') NOT NULL,\n  `employeeId` int(10) unsigned NOT NULL,\n  `previousContent` text DEFAULT NULL,\n  `newContent` text DEFAULT NULL,\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`id`),\n  KEY `idx_messageId` (`messageId`),\n  KEY `idx_createdAt` (`createdAt`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Staff Chat audit log for compliance (retained 2 years per ADR-4)'"
  }
]
