[
  {
    "type": "create_table",
    "description": "Create daybook_schedule_cache table for storing employee schedule data from external providers",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'daybook_schedule_cache'",
    "sql": "CREATE TABLE `daybook_schedule_cache` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `date` date NOT NULL, `employeeId` int(10) unsigned NOT NULL, `providerEmployeeId` varchar(50) DEFAULT NULL COMMENT 'External ID from WiW/Homebase', `provider` enum('wheniwork', 'homebase', 'manual') DEFAULT 'wheniwork', `shiftStart` datetime NOT NULL, `shiftEnd` datetime NOT NULL, `position` varchar(100) DEFAULT NULL, `notes` text DEFAULT NULL, `cachedAt` timestamp DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_date_employee` (`date`, `employeeId`), KEY `idx_date` (`date`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
  }
]
