[
  {
    "type": "create_table",
    "description": "Create storeRoles table for store-specific role configuration",
    "database": "kiosk_buykiosk",
    "check_query": "SELECT COUNT(*) as cnt FROM information_schema.tables WHERE table_schema = 'kiosk_buykiosk' AND table_name = 'storeRoles'",
    "check_value": "0",
    "sql": "CREATE TABLE `storeRoles` (`id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `typeNum` VARCHAR(10) NOT NULL COMMENT 'Store identifier (e.g., ou00, pa00)', `roleId` TINYINT UNSIGNED NOT NULL COMMENT 'Role ID (0-255)', `name` VARCHAR(50) NOT NULL COMMENT 'Display name for the role', `color` VARCHAR(7) NOT NULL COMMENT 'Hex color code (e.g., #3b82f6)', `sortOrder` TINYINT UNSIGNED DEFAULT 0 COMMENT 'Display ordering', `isActive` TINYINT(1) UNSIGNED DEFAULT 1 COMMENT 'Soft delete flag', `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY `idx_store_role` (`typeNum`, `roleId`), INDEX `idx_typenum` (`typeNum`), INDEX `idx_active` (`typeNum`, `isActive`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Store-specific role configuration'"
  }
]
