[
  {
    "type": "create_table",
    "description": "Create staff_chat_reactions table for emoji reactions on Staff Chat messages",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'staff_chat_reactions'",
    "sql": "CREATE TABLE `staff_chat_reactions` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `messageId` bigint(20) unsigned NOT NULL,\n  `employeeId` int(10) unsigned NOT NULL,\n  `emoji` varchar(20) NOT NULL COMMENT 'Unicode codepoint sequence',\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `uk_message_employee_emoji` (`messageId`, `employeeId`, `emoji`),\n  KEY `idx_messageId` (`messageId`),\n  CONSTRAINT `fk_staff_chat_reaction_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 emoji reactions per message'"
  }
]
