[
  {
    "type": "create_table",
    "description": "Create staff_chat_mentions table for @user mention tracking in Staff Chat messages",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'staff_chat_mentions'",
    "sql": "CREATE TABLE `staff_chat_mentions` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `messageId` bigint(20) unsigned NOT NULL,\n  `mentionedEmployeeId` int(10) unsigned NOT NULL,\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `uk_message_employee` (`messageId`, `mentionedEmployeeId`),\n  KEY `idx_mentionedEmployeeId` (`mentionedEmployeeId`),\n  CONSTRAINT `fk_staff_chat_mention_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 @mention tracking for notifications and inbox'"
  }
]
