[
  {
    "type": "create_table",
    "description": "Create staff_chat_attachments table for image attachments on Staff Chat messages",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'staff_chat_attachments'",
    "sql": "CREATE TABLE `staff_chat_attachments` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `messageId` bigint(20) unsigned NOT NULL,\n  `fileName` varchar(255) NOT NULL,\n  `originalName` varchar(255) NOT NULL,\n  `mimeType` varchar(100) NOT NULL,\n  `fileSize` int(10) unsigned NOT NULL COMMENT 'bytes',\n  `filePath` varchar(500) NOT NULL,\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`id`),\n  KEY `idx_messageId` (`messageId`),\n  CONSTRAINT `fk_staff_chat_attachment_message` FOREIGN KEY (`messageId`) REFERENCES `staff_chat_messages` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Staff Chat image attachments (JPEG, PNG, GIF)'"
  }
]
