/*增加店铺表，同时为相关表添加店铺id*/

/*增加店铺表*/
CREATE TABLE `shop_main`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '店铺id',
  `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '店铺名称',
  `status` tinyint NOT NULL COMMENT '店铺状态',
  `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '店铺表' ROW_FORMAT = Dynamic;



ALTER TABLE product_property ADD COLUMN shop_id bigint;  --商品属性项表加店铺id
ALTER TABLE product_property_value ADD COLUMN shop_id bigint;  --商品属性值表加店铺id
ALTER TABLE product_spu ADD COLUMN shop_id bigint;  --商品SPU表加店铺id
ALTER TABLE product_sku ADD COLUMN shop_id bigint;  --商品SKU表加店铺id
ALTER TABLE trade_order ADD COLUMN shop_id bigint;  --订单主表加店铺id
ALTER TABLE product_comment ADD COLUMN shop_id bigint;  --商品评价表加店铺id
ALTER TABLE trade_after_sale ADD COLUMN shop_id bigint;  --售后订单表加店铺id
ALTER TABLE trade_delivery_express_template ADD COLUMN shop_id bigint;  --快递运费模板主表加店铺id
ALTER TABLE trade_delivery_pick_up_store ADD COLUMN shop_id bigint;  --自提门店表加店铺id


