[
  {
    "type": "create_table",
    "description": "Create daybook_whiteboard_canvas table for daily canvas state storage",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'daybook_whiteboard_canvas'",
    "sql": "CREATE TABLE `daybook_whiteboard_canvas` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `date` date NOT NULL COMMENT 'The date this canvas is for',\n  `canvasData` longtext NOT NULL COMMENT 'JSON serialized Fabric.js canvas data',\n  `thumbnail` longtext DEFAULT NULL COMMENT 'Base64 encoded thumbnail image',\n  `lastModifiedBy` int(10) unsigned NULL COMMENT 'Employee ID who last modified (NULL for anonymous)',\n  `lastModifiedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `uk_date` (`date`),\n  KEY `idx_lastModifiedBy` (`lastModifiedBy`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Daily whiteboard canvas state'"
  },
  {
    "type": "create_table",
    "description": "Create daybook_whiteboard_items table for overlay items like sticky notes",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'daybook_whiteboard_items'",
    "sql": "CREATE TABLE `daybook_whiteboard_items` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `employeeId` int(10) unsigned NOT NULL COMMENT 'Employee who created the item',\n  `type` varchar(20) NOT NULL DEFAULT 'sticky' COMMENT 'Item type: sticky, text, image',\n  `content` text DEFAULT NULL COMMENT 'Text content of the item',\n  `positionX` int NOT NULL DEFAULT 0 COMMENT 'X position on canvas',\n  `positionY` int NOT NULL DEFAULT 0 COMMENT 'Y position on canvas',\n  `width` int NOT NULL DEFAULT 200 COMMENT 'Item width in pixels',\n  `height` int NOT NULL DEFAULT 150 COMMENT 'Item height in pixels',\n  `rotation` float NOT NULL DEFAULT 0 COMMENT 'Rotation angle in degrees',\n  `zIndex` int NOT NULL DEFAULT 0 COMMENT 'Layer order',\n  `backgroundColor` varchar(20) NOT NULL DEFAULT '#FFFF88' COMMENT 'Background color hex',\n  `textColor` varchar(20) NOT NULL DEFAULT '#000000' COMMENT 'Text color hex',\n  `fontSize` int NOT NULL DEFAULT 14 COMMENT 'Font size in pixels',\n  `expiresAt` datetime DEFAULT NULL COMMENT 'When item auto-expires (NULL = never)',\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  `updatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),\n  PRIMARY KEY (`id`),\n  KEY `idx_employeeId` (`employeeId`),\n  KEY `idx_expiresAt` (`expiresAt`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Whiteboard overlay items and sticky notes'"
  },
  {
    "type": "create_table",
    "description": "Create daybook_whiteboard_history table for audit log of whiteboard actions",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'daybook_whiteboard_history'",
    "sql": "CREATE TABLE `daybook_whiteboard_history` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `date` date NOT NULL COMMENT 'Date of the action',\n  `employeeId` int(10) unsigned NOT NULL COMMENT 'Employee who performed the action',\n  `action` varchar(50) NOT NULL COMMENT 'Action type: save, clear, add_item, delete_item',\n  `actionData` text DEFAULT NULL COMMENT 'JSON additional data about the action',\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`id`),\n  KEY `idx_date` (`date`),\n  KEY `idx_employeeId` (`employeeId`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Audit log for whiteboard actions'"
  }
]
