fix:修复 mall product promotion 测试 sql
This commit is contained in:
parent
331be53b8b
commit
9517ffdfb8
@ -126,82 +126,32 @@ CREATE TABLE IF NOT EXISTS `product_property_value` (
|
|||||||
PRIMARY KEY("id")
|
PRIMARY KEY("id")
|
||||||
) COMMENT '规格值';
|
) COMMENT '规格值';
|
||||||
|
|
||||||
-- TODO @puhui999:格式不太对哈
|
DROP TABLE IF EXISTS `product_comment` (
|
||||||
CREATE TABLE IF NOT EXISTS `product_comment`
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '评论编号,主键自增',
|
||||||
(
|
`user_id` bigint DEFAULT NULL COMMENT '评价人的用户编号关联 MemberUserDO 的 id 编号',
|
||||||
`id`
|
`user_nickname` varchar(255) DEFAULT NULL COMMENT '评价人名称',
|
||||||
bigint
|
`user_avatar` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '评价人头像',
|
||||||
NOT
|
`anonymous` bit(1) DEFAULT NULL COMMENT '是否匿名',
|
||||||
NULL
|
|
||||||
AUTO_INCREMENT
|
|
||||||
COMMENT
|
|
||||||
'评论编号,主键自增',
|
|
||||||
`user_id`
|
|
||||||
bigint
|
|
||||||
DEFAULT
|
|
||||||
NULL
|
|
||||||
COMMENT
|
|
||||||
'评价人的用户编号关联 MemberUserDO 的 id 编号',
|
|
||||||
`user_nickname`
|
|
||||||
varchar
|
|
||||||
(
|
|
||||||
255
|
|
||||||
) DEFAULT NULL COMMENT '评价人名称',
|
|
||||||
`user_avatar` varchar
|
|
||||||
(
|
|
||||||
1024
|
|
||||||
) DEFAULT NULL COMMENT '评价人头像',
|
|
||||||
`anonymous` bit
|
|
||||||
(
|
|
||||||
1
|
|
||||||
) DEFAULT NULL COMMENT '是否匿名',
|
|
||||||
`order_id` bigint DEFAULT NULL COMMENT '交易订单编号关联 TradeOrderDO 的 id 编号',
|
`order_id` bigint DEFAULT NULL COMMENT '交易订单编号关联 TradeOrderDO 的 id 编号',
|
||||||
`order_item_id` bigint DEFAULT NULL COMMENT '交易订单项编号关联 TradeOrderItemDO 的 id 编号',
|
`order_item_id` bigint DEFAULT NULL COMMENT '交易订单项编号关联 TradeOrderItemDO 的 id 编号',
|
||||||
`spu_id` bigint DEFAULT NULL COMMENT '商品 SPU 编号关联 ProductSpuDO 的 id',
|
`spu_id` bigint DEFAULT NULL COMMENT '商品 SPU 编号关联 ProductSpuDO 的 id',
|
||||||
`spu_name` varchar
|
`spu_name` varchar(255) DEFAULT NULL COMMENT '商品 SPU 名称',
|
||||||
(
|
|
||||||
255
|
|
||||||
) DEFAULT NULL COMMENT '商品 SPU 名称',
|
|
||||||
`sku_id` bigint DEFAULT NULL COMMENT '商品 SKU 编号关联 ProductSkuDO 的 id 编号',
|
`sku_id` bigint DEFAULT NULL COMMENT '商品 SKU 编号关联 ProductSkuDO 的 id 编号',
|
||||||
`visible` bit
|
`visible` bit(1) DEFAULT NULL COMMENT '是否可见true:显示false:隐藏',
|
||||||
(
|
|
||||||
1
|
|
||||||
) DEFAULT NULL COMMENT '是否可见true:显示false:隐藏',
|
|
||||||
`scores` tinyint DEFAULT NULL COMMENT '评分星级1-5分',
|
`scores` tinyint DEFAULT NULL COMMENT '评分星级1-5分',
|
||||||
`description_scores` tinyint DEFAULT NULL COMMENT '描述星级1-5 星',
|
`description_scores` tinyint DEFAULT NULL COMMENT '描述星级1-5 星',
|
||||||
`benefit_scores` tinyint DEFAULT NULL COMMENT '服务星级1-5 星',
|
`benefit_scores` tinyint DEFAULT NULL COMMENT '服务星级1-5 星',
|
||||||
`content` varchar
|
`content` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '评论内容',
|
||||||
(
|
`pic_urls` varchar(4096) DEFAULT NULL COMMENT '评论图片地址数组',
|
||||||
1024
|
`reply_status` bit(1) DEFAULT NULL COMMENT '商家是否回复',
|
||||||
) DEFAULT NULL COMMENT '评论内容',
|
|
||||||
`pic_urls` varchar
|
|
||||||
(
|
|
||||||
4096
|
|
||||||
) DEFAULT NULL COMMENT '评论图片地址数组',
|
|
||||||
`reply_status` bit
|
|
||||||
(
|
|
||||||
1
|
|
||||||
) DEFAULT NULL COMMENT '商家是否回复',
|
|
||||||
`reply_user_id` bigint DEFAULT NULL COMMENT '回复管理员编号关联 AdminUserDO 的 id 编号',
|
`reply_user_id` bigint DEFAULT NULL COMMENT '回复管理员编号关联 AdminUserDO 的 id 编号',
|
||||||
`reply_content` varchar
|
`reply_content` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '商家回复内容',
|
||||||
(
|
|
||||||
1024
|
|
||||||
) DEFAULT NULL COMMENT '商家回复内容',
|
|
||||||
`reply_time` datetime DEFAULT NULL COMMENT '商家回复时间',
|
`reply_time` datetime DEFAULT NULL COMMENT '商家回复时间',
|
||||||
`creator` varchar
|
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
|
||||||
(
|
|
||||||
64
|
|
||||||
) DEFAULT '' COMMENT '创建者',
|
|
||||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
`updater` varchar
|
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
|
||||||
(
|
|
||||||
64
|
|
||||||
) DEFAULT '' COMMENT '更新者',
|
|
||||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||||
"tenant_id" bigint not null default '0',
|
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||||
PRIMARY KEY
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
(
|
) ENGINE = InnoDB AUTO_INCREMENT = 26 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '商品评论';
|
||||||
`id`
|
|
||||||
)
|
|
||||||
) COMMENT '产品评论表';
|
|
@ -1,14 +1,7 @@
|
|||||||
DELETE
|
DELETE FROM "market_activity";
|
||||||
FROM "market_activity";
|
DELETE FROM "promotion_coupon_template";
|
||||||
DELETE
|
DELETE FROM "promotion_coupon";
|
||||||
FROM "promotion_coupon_template";
|
DELETE FROM "promotion_reward_activity";
|
||||||
DELETE
|
DELETE FROM "promotion_discount_activity";
|
||||||
FROM "promotion_coupon";
|
DELETE FROM "promotion_discount_product";
|
||||||
DELETE
|
DELETE FROM "promotion_seckill_config";
|
||||||
FROM "promotion_reward_activity";
|
|
||||||
DELETE
|
|
||||||
FROM "promotion_discount_activity";
|
|
||||||
DELETE
|
|
||||||
FROM "promotion_discount_product";
|
|
||||||
DELETE
|
|
||||||
FROM "promotion_seckill_config";
|
|
||||||
|
@ -107,123 +107,45 @@ CREATE TABLE IF NOT EXISTS "promotion_discount_activity" (
|
|||||||
PRIMARY KEY ("id")
|
PRIMARY KEY ("id")
|
||||||
) COMMENT '限时折扣活动';
|
) COMMENT '限时折扣活动';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "promotion_discount_product" (
|
-- 将该建表 SQL 语句,添加到 yudao-module-promotion-biz 模块的 test/resources/sql/create_tables.sql 文件里
|
||||||
|
CREATE TABLE IF NOT EXISTS "promotion_seckill_activity" (
|
||||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||||
"activity_id" bigint NOT NULL,
|
|
||||||
"spu_id" bigint NOT NULL,
|
"spu_id" bigint NOT NULL,
|
||||||
"sku_id" bigint NOT NULL,
|
"name" varchar NOT NULL,
|
||||||
"discount_type" int NOT NULL,
|
"status" int NOT NULL,
|
||||||
"discount_percent"
|
"remark" varchar,
|
||||||
int,
|
"start_time" varchar NOT NULL,
|
||||||
"discount_price"
|
"end_time" varchar NOT NULL,
|
||||||
int,
|
"sort" int NOT NULL,
|
||||||
"creator"
|
"config_ids" varchar NOT NULL,
|
||||||
varchar
|
"order_count" int NOT NULL,
|
||||||
DEFAULT
|
"user_count" int NOT NULL,
|
||||||
'',
|
"total_price" int NOT NULL,
|
||||||
"create_time"
|
"total_limit_count" int,
|
||||||
datetime
|
"single_limit_count" int,
|
||||||
NOT
|
"stock" int,
|
||||||
NULL
|
"total_stock" int,
|
||||||
DEFAULT
|
"creator" varchar DEFAULT '',
|
||||||
CURRENT_TIMESTAMP,
|
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
"updater"
|
"updater" varchar DEFAULT '',
|
||||||
varchar
|
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
DEFAULT
|
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||||
'',
|
"tenant_id" bigint NOT NULL,
|
||||||
"update_time"
|
PRIMARY KEY ("id")
|
||||||
datetime
|
) COMMENT '秒杀活动';
|
||||||
NOT
|
|
||||||
NULL
|
|
||||||
DEFAULT
|
|
||||||
CURRENT_TIMESTAMP
|
|
||||||
ON
|
|
||||||
UPDATE
|
|
||||||
CURRENT_TIMESTAMP,
|
|
||||||
"deleted"
|
|
||||||
bit
|
|
||||||
NOT
|
|
||||||
NULL
|
|
||||||
DEFAULT
|
|
||||||
FALSE,
|
|
||||||
PRIMARY
|
|
||||||
KEY
|
|
||||||
(
|
|
||||||
"id"
|
|
||||||
)
|
|
||||||
) COMMENT '限时折扣活动';
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "promotion_seckill_config"
|
CREATE TABLE IF NOT EXISTS "promotion_seckill_config" (
|
||||||
(
|
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||||
"id"
|
"name" varchar NOT NULL,
|
||||||
bigint
|
"start_time" varchar NOT NULL,
|
||||||
NOT
|
"end_time" varchar NOT NULL,
|
||||||
NULL
|
"pic_url" varchar NOT NULL,
|
||||||
GENERATED
|
"status" int NOT NULL,
|
||||||
BY
|
"creator" varchar DEFAULT '',
|
||||||
DEFAULT AS
|
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
IDENTITY,
|
"updater" varchar DEFAULT '',
|
||||||
"name"
|
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
varchar
|
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||||
NOT
|
"tenant_id" bigint NOT NULL,
|
||||||
NULL,
|
PRIMARY KEY ("id")
|
||||||
"start_time"
|
|
||||||
varchar
|
|
||||||
NOT
|
|
||||||
NULL,
|
|
||||||
"end_time"
|
|
||||||
varchar
|
|
||||||
NOT
|
|
||||||
NULL,
|
|
||||||
"seckill_activity_count"
|
|
||||||
int
|
|
||||||
NOT
|
|
||||||
NULL,
|
|
||||||
"pic_url"
|
|
||||||
varchar
|
|
||||||
NOT
|
|
||||||
NULL,
|
|
||||||
"status"
|
|
||||||
varchar
|
|
||||||
NOT
|
|
||||||
NULL,
|
|
||||||
"creator"
|
|
||||||
varchar
|
|
||||||
DEFAULT
|
|
||||||
'',
|
|
||||||
"create_time"
|
|
||||||
datetime
|
|
||||||
NOT
|
|
||||||
NULL
|
|
||||||
DEFAULT
|
|
||||||
CURRENT_TIMESTAMP,
|
|
||||||
"updater"
|
|
||||||
varchar
|
|
||||||
DEFAULT
|
|
||||||
'',
|
|
||||||
"update_time"
|
|
||||||
datetime
|
|
||||||
NOT
|
|
||||||
NULL
|
|
||||||
DEFAULT
|
|
||||||
CURRENT_TIMESTAMP
|
|
||||||
ON
|
|
||||||
UPDATE
|
|
||||||
CURRENT_TIMESTAMP,
|
|
||||||
"deleted"
|
|
||||||
bit
|
|
||||||
NOT
|
|
||||||
NULL
|
|
||||||
DEFAULT
|
|
||||||
FALSE,
|
|
||||||
"tenant_id"
|
|
||||||
bigint
|
|
||||||
NOT
|
|
||||||
NULL,
|
|
||||||
PRIMARY
|
|
||||||
KEY
|
|
||||||
(
|
|
||||||
"id"
|
|
||||||
)
|
|
||||||
) COMMENT '秒杀时段配置';
|
) COMMENT '秒杀时段配置';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user