fix:修复 mall product promotion 测试 sql

This commit is contained in:
puhui999 2023-06-20 09:06:32 +08:00
parent 331be53b8b
commit 9517ffdfb8
3 changed files with 67 additions and 202 deletions

View File

@ -126,82 +126,32 @@ CREATE TABLE IF NOT EXISTS `product_property_value` (
PRIMARY KEY("id")
) COMMENT '规格值';
-- TODO @puhui999格式不太对哈
CREATE TABLE IF NOT EXISTS `product_comment`
(
`id`
bigint
NOT
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 '是否匿名',
DROP TABLE IF EXISTS `product_comment` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '评论编号主键自增',
`user_id` bigint DEFAULT NULL COMMENT '评价人的用户编号关联 MemberUserDO id 编号',
`user_nickname` varchar(255) DEFAULT NULL COMMENT '评价人名称',
`user_avatar` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '评价人头像',
`anonymous` bit(1) DEFAULT NULL COMMENT '是否匿名',
`order_id` bigint DEFAULT NULL COMMENT '交易订单编号关联 TradeOrderDO id 编号',
`order_item_id` bigint DEFAULT NULL COMMENT '交易订单项编号关联 TradeOrderItemDO id 编号',
`spu_id` bigint DEFAULT NULL COMMENT '商品 SPU 编号关联 ProductSpuDO id',
`spu_name` varchar
(
255
) DEFAULT NULL COMMENT '商品 SPU 名称',
`spu_name` varchar(255) DEFAULT NULL COMMENT '商品 SPU 名称',
`sku_id` bigint DEFAULT NULL COMMENT '商品 SKU 编号关联 ProductSkuDO id 编号',
`visible` bit
(
1
) DEFAULT NULL COMMENT '是否可见true:显示false:隐藏',
`visible` bit(1) DEFAULT NULL COMMENT '是否可见true:显示false:隐藏',
`scores` tinyint DEFAULT NULL COMMENT '评分星级1-5分',
`description_scores` tinyint DEFAULT NULL COMMENT '描述星级1-5 ',
`benefit_scores` tinyint DEFAULT NULL COMMENT '服务星级1-5 ',
`content` varchar
(
1024
) DEFAULT NULL COMMENT '评论内容',
`pic_urls` varchar
(
4096
) DEFAULT NULL COMMENT '评论图片地址数组',
`reply_status` bit
(
1
) DEFAULT NULL COMMENT '商家是否回复',
`content` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci 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_content` varchar
(
1024
) DEFAULT NULL COMMENT '商家回复内容',
`reply_content` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '商家回复内容',
`reply_time` datetime DEFAULT NULL COMMENT '商家回复时间',
`creator` varchar
(
64
) DEFAULT '' COMMENT '创建者',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar
(
64
) DEFAULT '' COMMENT '更新者',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
"deleted" bit NOT NULL DEFAULT FALSE,
"tenant_id" bigint not null default '0',
PRIMARY KEY
(
`id`
)
) 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 = 26 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '商品评论';

View File

@ -1,14 +1,7 @@
DELETE
FROM "market_activity";
DELETE
FROM "promotion_coupon_template";
DELETE
FROM "promotion_coupon";
DELETE
FROM "promotion_reward_activity";
DELETE
FROM "promotion_discount_activity";
DELETE
FROM "promotion_discount_product";
DELETE
FROM "promotion_seckill_config";
DELETE FROM "market_activity";
DELETE FROM "promotion_coupon_template";
DELETE FROM "promotion_coupon";
DELETE FROM "promotion_reward_activity";
DELETE FROM "promotion_discount_activity";
DELETE FROM "promotion_discount_product";
DELETE FROM "promotion_seckill_config";

View File

@ -107,123 +107,45 @@ CREATE TABLE IF NOT EXISTS "promotion_discount_activity" (
PRIMARY KEY ("id")
) 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,
"activity_id" bigint NOT NULL,
"spu_id" bigint NOT NULL,
"sku_id" bigint NOT NULL,
"discount_type" int NOT NULL,
"discount_percent"
int,
"discount_price"
int,
"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,
PRIMARY
KEY
(
"id"
)
) COMMENT '限时折扣活动';
"name" varchar NOT NULL,
"status" int NOT NULL,
"remark" varchar,
"start_time" varchar NOT NULL,
"end_time" varchar NOT NULL,
"sort" int NOT NULL,
"config_ids" varchar NOT NULL,
"order_count" int NOT NULL,
"user_count" int NOT NULL,
"total_price" int NOT NULL,
"total_limit_count" int,
"single_limit_count" int,
"stock" int,
"total_stock" int,
"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 '秒杀活动';
CREATE TABLE IF NOT EXISTS "promotion_seckill_config"
(
"id"
bigint
NOT
NULL
GENERATED
BY
DEFAULT AS
IDENTITY,
"name"
varchar
NOT
NULL,
"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"
)
CREATE TABLE IF NOT EXISTS "promotion_seckill_config" (
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"name" varchar NOT NULL,
"start_time" varchar NOT NULL,
"end_time" varchar NOT NULL,
"pic_url" varchar NOT NULL,
"status" int 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 '秒杀时段配置';