game_consume_items.sql 1.6 KB

123456789101112131415161718192021
  1. -- ******************************************************************
  2. -- 表 kku_game_consume_items 的创建SQL
  3. -- 对应的Model: App\Module\Game\Models\GameConsumeItem
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_game_consume_items` (
  7. `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  8. `group_id` int unsigned NOT NULL COMMENT '消耗组ID,外键关联game_consume_groups表',
  9. `consume_type` tinyint unsigned NOT NULL COMMENT '消耗类型(1:物品, 2:货币)',
  10. `target_id` int unsigned NOT NULL COMMENT '目标ID(物品ID、货币ID等,根据consume_type解释)',
  11. `param1` int NOT NULL DEFAULT '0' COMMENT '参数1(根据consume_type不同含义,如物品的品质、货币的来源等)',
  12. `param2` int NOT NULL DEFAULT '0' COMMENT '参数2(根据consume_type不同含义,如物品的绑定状态、货币的类型等)',
  13. `quantity` int unsigned NOT NULL DEFAULT '1' COMMENT '数量',
  14. `extra_data` json DEFAULT NULL COMMENT '额外数据(JSON格式,可存储特定消耗类型的额外参数)',
  15. `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  16. `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  17. PRIMARY KEY (`id`),
  18. KEY `game_consume_items_group_id_foreign` (`group_id`),
  19. CONSTRAINT `game_consume_items_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `kku_game_consume_groups` (`id`) ON DELETE CASCADE
  20. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='消耗项';