item_pity_times.sql 1.4 KB

123456789101112131415161718192021
  1. -- ******************************************************************
  2. -- 表 kku_item_pity_times 的创建SQL
  3. -- 对应的Model: App\Module\GameItems\Models\ItemPityTime
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_item_pity_times` (
  7. `id` int NOT NULL AUTO_INCREMENT COMMENT '记录ID,主键',
  8. `user_id` int NOT NULL COMMENT '用户ID',
  9. `chest_id` int NOT NULL COMMENT '宝箱ID,外键关联kku_item_items表',
  10. `chest_content_id` int NOT NULL COMMENT '宝箱内容ID,外键关联kku_item_chest_contents表',
  11. `current_count` int NOT NULL DEFAULT '0' COMMENT '当前计数,每开启一次宝箱增加1',
  12. `last_reset_time` timestamp NULL DEFAULT NULL COMMENT '上次重置时间(可用于周期性重置)',
  13. `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  14. `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  15. PRIMARY KEY (`id`) USING BTREE,
  16. UNIQUE KEY `idx_user_chest_content` (`user_id`,`chest_id`,`chest_content_id`) USING BTREE,
  17. KEY `fk_pity_chest` (`chest_id`) USING BTREE,
  18. KEY `fk_pity_content` (`chest_content_id`) USING BTREE,
  19. CONSTRAINT `fk_pity_chest` FOREIGN KEY (`chest_id`) REFERENCES `kku_item_items` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
  20. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户宝箱内容保底计数表';