shop_promotions.sql 1.8 KB

12345678910111213141516171819202122232425
  1. -- ******************************************************************
  2. -- 表 kku_shop_promotions 的创建SQL
  3. -- 对应的Model: App\Module\Shop\Models\ShopPromotion
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_shop_promotions` (
  7. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '促销ID,主键',
  8. `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '促销名称',
  9. `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '促销描述',
  10. `banner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '促销横幅图片',
  11. `discount_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '折扣类型(1:固定折扣, 2:百分比折扣)',
  12. `discount_value` int(11) NOT NULL COMMENT '折扣值(固定折扣为具体金额,百分比折扣为1-100的整数)',
  13. `is_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否激活(0:否, 1:是)',
  14. `sort_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序权重',
  15. `start_time` timestamp NULL DEFAULT NULL COMMENT '开始时间',
  16. `end_time` timestamp NULL DEFAULT NULL COMMENT '结束时间',
  17. `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  18. `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  19. PRIMARY KEY (`id`) USING BTREE,
  20. KEY `shop_promotions_is_active_index` (`is_active`) USING BTREE,
  21. KEY `shop_promotions_sort_order_index` (`sort_order`) USING BTREE,
  22. KEY `shop_promotions_start_time_index` (`start_time`) USING BTREE,
  23. KEY `shop_promotions_end_time_index` (`end_time`) USING BTREE
  24. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='商店促销活动表';