CREATE TABLE IF NOT EXISTS `la_ai_quota_unlock` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户ID',
  `analysis_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '分析类型',
  `analysis_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '分析唯一Key',
  `ref_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联ID或哈希ID',
  `create_time` int UNSIGNED NULL DEFAULT NULL COMMENT '解锁时间',
  `update_time` int UNSIGNED NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_user_analysis` (`user_id` ASC, `analysis_key` ASC) USING BTREE,
  INDEX `idx_user_type` (`user_id` ASC, `analysis_type` ASC) USING BTREE,
  INDEX `idx_analysis_key` (`analysis_key` ASC) USING BTREE
) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'AI分析通用解锁记录表' ROW_FORMAT = Dynamic;
