[
  {
    "type": "create_table",
    "description": "Create userPayRates table for employee hourly rate history",
    "database": "kiosk_users",
    "check_query": "SHOW TABLES LIKE 'userPayRates'",
    "sql": "CREATE TABLE `userPayRates` (\n  `payRateId` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `userId` int(10) unsigned NOT NULL COMMENT 'FK to users.id',\n  `typeNum` varchar(10) DEFAULT NULL COMMENT 'Store-specific rate (NULL = global default)',\n  `hourlyRate` decimal(10,2) NOT NULL COMMENT 'Hourly pay rate',\n  `effectiveAt` datetime NOT NULL COMMENT 'When rate becomes effective (UTC)',\n  `createdByUserId` int(10) unsigned NOT NULL COMMENT 'User who set the rate',\n  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`payRateId`),\n  KEY `idx_user_effective` (`userId`, `effectiveAt`),\n  KEY `idx_typenum_user_effective` (`typeNum`, `userId`, `effectiveAt`),\n  CONSTRAINT `fk_userPayRates_user` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Employee hourly pay rate history'"
  }
]
