shop_items.sql 1.9 KB

123456789101112131415161718192021222324252627282930
  1. -- ******************************************************************
  2. -- 表 kku_shop_items 的创建SQL
  3. -- 对应的Model: App\Module\Shop\Models\ShopItem
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_shop_items` (
  7. `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '商品ID,主键',
  8. `name` varchar(100) NOT NULL COMMENT '商品名称',
  9. `description` text COMMENT '商品描述',
  10. `category_id` int unsigned NOT NULL COMMENT '分类ID,外键关联kku_shop_categories表',
  11. `category_name` varchar(100) DEFAULT NULL COMMENT '分类名称(字符串格式,区别于现有分类机制)',
  12. `consume_group_id` int unsigned DEFAULT NULL COMMENT '消耗组ID,外键关联kku_game_consume_groups表',
  13. `reward_group_id` int unsigned DEFAULT NULL COMMENT '奖励组ID,外键关联kku_game_reward_groups表',
  14. `max_single_buy` int NOT NULL DEFAULT '0' COMMENT '单次最大购买数量(0表示无限制)',
  15. `is_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否激活(0:否, 1:是)',
  16. `sort_order` int NOT NULL DEFAULT '0' COMMENT '排序权重',
  17. `image` varchar(255) DEFAULT NULL COMMENT '商品图片',
  18. `start_time` timestamp NULL DEFAULT NULL COMMENT '上架时间',
  19. `end_time` timestamp NULL DEFAULT NULL COMMENT '下架时间',
  20. `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  21. `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  22. PRIMARY KEY (`id`),
  23. KEY `shop_items_category_id_index` (`category_id`),
  24. KEY `shop_items_is_active_index` (`is_active`),
  25. KEY `shop_items_sort_order_index` (`sort_order`),
  26. KEY `shop_items_consume_group_id_index` (`consume_group_id`),
  27. KEY `shop_items_reward_group_id_index` (`reward_group_id`),
  28. KEY `shop_items_max_single_buy_index` (`max_single_buy`)
  29. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商店商品表';