[
  {
    "type": "create_table",
    "description": "Create employee_sync_log table for tracking all sync operations from external providers",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'employee_sync_log'",
    "sql": "CREATE TABLE `employee_sync_log` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `provider` enum('wheniwork','homebase') NOT NULL COMMENT 'External provider that was synced',\n  `action` enum('create','update','deactivate','reactivate','error','sync_complete') NOT NULL COMMENT 'Type of sync operation',\n  `employeeId` int(10) unsigned DEFAULT NULL COMMENT 'Local employee ID affected',\n  `externalId` varchar(50) DEFAULT NULL COMMENT 'External provider user ID',\n  `details` text DEFAULT NULL COMMENT 'JSON with sync details or error message',\n  `syncedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'When the sync operation occurred',\n  PRIMARY KEY (`id`),\n  KEY `idx_provider` (`provider`),\n  KEY `idx_employeeId` (`employeeId`),\n  KEY `idx_syncedAt` (`syncedAt`),\n  KEY `idx_action` (`action`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Track employee sync operations for debugging and audit'"
  }
]
