| 12345678910111213141516171819202122 |
- -- ******************************************************************
- -- 表 kku_item_user_recipes 的创建SQL
- -- 对应的Model: App\Module\GameItems\Models\ItemUserRecipe
- -- 警告: 此文件由系统自动生成,禁止手动修改!
- -- ******************************************************************
- DROP TABLE IF EXISTS `kku_item_user_recipes`;
- CREATE TABLE `kku_item_user_recipes` (
- `id` int NOT NULL AUTO_INCREMENT COMMENT '记录ID,主键',
- `user_id` int NOT NULL COMMENT '用户ID',
- `recipe_id` int NOT NULL COMMENT '配方ID,外键关联kku_item_recipes表',
- `is_unlocked` tinyint DEFAULT '0' COMMENT '是否已解锁(0:否, 1:是)',
- `unlock_time` timestamp NULL DEFAULT NULL COMMENT '解锁时间',
- `last_craft_time` timestamp NULL DEFAULT NULL COMMENT '最后合成时间',
- `craft_count` int DEFAULT '0' COMMENT '合成次数',
- `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_user_recipe` (`user_id`,`recipe_id`),
- KEY `fk_user_recipe` (`recipe_id`),
- CONSTRAINT `fk_user_recipe` FOREIGN KEY (`recipe_id`) REFERENCES `kku_item_recipes` (`id`) ON DELETE CASCADE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户配方解锁状态表';
|