[
  {
    "type": "create_table",
    "description": "Create dlAccessLog table for auditing driver's license access with signature consent",
    "database": "kiosk_buykiosk",
    "check_query": "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'kiosk_buykiosk' AND TABLE_NAME = 'dlAccessLog'",
    "sql": "CREATE TABLE `dlAccessLog` (`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `userId` INT UNSIGNED NOT NULL COMMENT 'User who accessed the DL', `userName` VARCHAR(200) NOT NULL COMMENT 'Denormalized user display name at time of access', `typeNum` VARCHAR(10) NOT NULL COMMENT 'Store where customer record lives', `customerId` INT UNSIGNED NOT NULL COMMENT 'Customer whose DL was viewed', `signatureData` MEDIUMTEXT NOT NULL COMMENT 'Base64 PNG signature from canvas', `signatureType` ENUM('canvas','checkbox') NOT NULL DEFAULT 'canvas' COMMENT 'canvas=drawn signature, checkbox=device fallback', `termsVersion` VARCHAR(20) NOT NULL COMMENT 'Version of T&C agreed to', `ipAddress` VARCHAR(45) NOT NULL COMMENT 'Client IP (supports IPv6)', `userAgent` TEXT NULL COMMENT 'Browser user agent string', `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), INDEX `idx_userId` (`userId`), INDEX `idx_typeNum_customerId` (`typeNum`, `customerId`), INDEX `idx_createdAt` (`createdAt`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Audit trail for driver license number access with signed consent'"
  }
]
