[
  {
    "type": "create_table",
    "description": "Create user_employee_links table for linking uf_user to employee records",
    "database": "kiosk_users",
    "check_query": "SHOW TABLES LIKE 'user_employee_links'",
    "sql": "CREATE TABLE `user_employee_links` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userId` int(11) NOT NULL COMMENT 'FK to uf_user.id', `typeNum` varchar(10) NOT NULL COMMENT 'Store identifier (e.g., pa00, ou00)', `employeeId` int(10) unsigned NOT NULL COMMENT 'FK to employees.employeeID in store DB', `linkType` enum('auto_name','auto_login','manual','promotion') DEFAULT 'manual', `linkedAt` timestamp DEFAULT current_timestamp(), `linkedBy` int(11) DEFAULT NULL COMMENT 'User who created the link (NULL for auto)', PRIMARY KEY (`id`), UNIQUE KEY `user_store` (`userId`, `typeNum`), UNIQUE KEY `store_employee` (`typeNum`, `employeeId`), KEY `idx_userId` (`userId`), KEY `idx_typeNum_employeeId` (`typeNum`, `employeeId`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
  }
]
