item_items.sql 2.5 KB

123456789101112131415161718192021222324252627282930313233
  1. -- ******************************************************************
  2. -- 表 kku_item_items 的创建SQL
  3. -- 对应的Model: App\Module\GameItems\Models\Item
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_item_items` (
  7. `id` int NOT NULL AUTO_INCREMENT COMMENT '物品ID,主键',
  8. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '物品名称',
  9. `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '物品描述',
  10. `category_id` int NOT NULL COMMENT '物品分类ID,外键关联kku_item_categories表',
  11. `type` tinyint NOT NULL COMMENT '物品类型(1:可使用, 2:可装备, 3:可合成, 4:可交任务, 5:可开启...)',
  12. `is_unique` tinyint DEFAULT '0' COMMENT '是否是单独属性物品(0:否,默认, 1:是)',
  13. `max_stack` int DEFAULT '0' COMMENT '最大堆叠数量(0表示无限堆叠)',
  14. `sell_price` int DEFAULT '0' COMMENT '出售价格',
  15. `tradable` tinyint DEFAULT '1' COMMENT '是否可交易(0:不可交易, 1:可交易,默认)',
  16. `dismantlable` tinyint DEFAULT '1' COMMENT '是否可分解(0:不可分解, 1:可分解,默认)',
  17. `default_expire_seconds` int DEFAULT '0' COMMENT '玩家获取物品后的默认有效秒数(0表示永久有效)',
  18. `display_attributes` json DEFAULT NULL COMMENT '展示属性,以JSON格式存储键值对,用于界面展示和描述的属性',
  19. `numeric_attributes` json DEFAULT NULL COMMENT '数值属性,以JSON格式存储键值对,用于计算和游戏逻辑的属性',
  20. `global_expire_at` timestamp NULL DEFAULT NULL COMMENT '物品全局过期时间(可为空)',
  21. `chest_consume_group_id` int DEFAULT NULL COMMENT '宝箱开启消耗组ID(仅宝箱类型物品使用)',
  22. `chest_reward_group_id` int DEFAULT NULL COMMENT '宝箱开启奖励组ID(仅宝箱类型物品使用)',
  23. `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  24. `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  25. PRIMARY KEY (`id`) USING BTREE,
  26. KEY `idx_category_id` (`category_id`) USING BTREE,
  27. KEY `idx_type` (`type`) USING BTREE,
  28. KEY `idx_is_unique` (`is_unique`) USING BTREE,
  29. KEY `idx_tradable` (`tradable`) USING BTREE,
  30. KEY `idx_dismantlable` (`dismantlable`) USING BTREE,
  31. KEY `idx_global_expire_at` (`global_expire_at`) USING BTREE
  32. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='统一属性物品表';