| 12345678910111213141516 |
- -- 修改后的用户任务进度表(关联到任务达成条件)
- DROP TABLE IF EXISTS `kku_task_user_progress`;
- CREATE TABLE `kku_task_user_progress` (
- `id` int NOT NULL AUTO_INCREMENT COMMENT '记录ID,主键',
- `user_id` int NOT NULL COMMENT '用户ID',
- `task_id` int NOT NULL COMMENT '任务ID,外键关联kku_task_tasks表',
- `achievement_condition_id` int NOT NULL COMMENT '达成条件ID,外键关联kku_task_achievement_conditions表',
- `current_value` int NOT NULL DEFAULT '0' COMMENT '当前值',
- `last_update_time` timestamp NULL DEFAULT NULL COMMENT '最后更新时间',
- `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_user_task_condition` (`user_id`, `task_id`, `achievement_condition_id`),
- KEY `idx_user_task` (`user_id`, `task_id`),
- KEY `idx_achievement_condition` (`achievement_condition_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户任务进度表';
|