feat:
1. prod
This commit is contained in:
@@ -1,103 +1,58 @@
|
|||||||
CREATE TABLE package_info
|
--- 用户积分 = user_point
|
||||||
|
--- 现金券 = cash_coupon
|
||||||
|
--- 福利包 = benefit_package
|
||||||
|
--- 福利积分 = benefit_point
|
||||||
|
--- 福利值 = benefit_value
|
||||||
|
|
||||||
|
CREATE TABLE user_market_benefit_package_template --积分包信息模板表
|
||||||
(
|
(
|
||||||
id int8 NOT NULL PRIMARY KEY,
|
id int8 NOT NULL PRIMARY KEY,
|
||||||
name VARCHAR(128) NULL,
|
package_name VARCHAR(128) NULL,
|
||||||
buy_qty int4 default 0, -- 最大购买数量
|
user_limit int4 default 0, -- 最大购买数量
|
||||||
day_total int4 default 0, -- 产出总天数
|
max_limit int4 default 0, -- 全网最大兑换数量
|
||||||
amount_total decimal(14, 2) default 0, -- 总产出福利积分
|
day_limit int4 default 0, -- 产出总天数
|
||||||
give_amount decimal(14, 2) default 0, -- 购买赠与福利值
|
benefit_point_amount decimal(14, 2) default 0, -- 总产出福利积分
|
||||||
bonus decimal(16, 4) default 0, -- 激活比率
|
benefit_value_amount decimal(14, 2) default 0, -- 购买赠与福利值
|
||||||
user_benefit decimal(14, 2) default 0, --兑换包需要的福利积分
|
benefit_point_price decimal(14, 2) default 0, --兑换包需要的福利积分
|
||||||
user_cash decimal(14, 2) default 0, --兑换包需要的现金券
|
cash_coupon_price decimal(14, 2) default 0, --兑换包需要的现金券
|
||||||
is_need_benefit int4 DEFAULT 0, --是否需要福利积分
|
exchanged_quantity int4 default 0, -- 已兑换数量
|
||||||
is_need_cash int4 DEFAULT 0, --是否需要现金券
|
create_user int8,
|
||||||
max_exchange_qty int4 default 0, -- 全网最大兑换数量
|
create_dept int8,
|
||||||
exchanged_qty int4 default 0, -- 已兑换数量
|
create_time timestamp(6),
|
||||||
version int4 default 1,
|
update_user int8,
|
||||||
create_user int8,
|
update_time timestamp(6),
|
||||||
create_dept int8,
|
status int4 default 1,
|
||||||
create_time timestamp(6),
|
is_deleted int4 default 0
|
||||||
update_user int8,
|
|
||||||
update_time timestamp(6),
|
|
||||||
status int4 default 1,
|
|
||||||
is_deleted int4 default 0
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE package_info IS '积分包信息表';
|
COMMENT ON TABLE user_market_package_info IS '积分包信息表';
|
||||||
COMMENT ON COLUMN package_info.id IS '主键';
|
COMMENT ON COLUMN user_market_package_info.id IS '主键';
|
||||||
COMMENT ON COLUMN package_info.name IS '积分包名称';
|
COMMENT ON COLUMN user_market_package_info.name IS '积分包名称';
|
||||||
COMMENT ON COLUMN package_info.buy_qty IS '最大购买数量';
|
COMMENT ON COLUMN user_market_package_info.buy_qty IS '最大购买数量';
|
||||||
COMMENT ON COLUMN package_info.day_total IS '产出总天数';
|
COMMENT ON COLUMN user_market_package_info.day_total IS '产出总天数';
|
||||||
COMMENT ON COLUMN package_info.amount_total IS '总产出福利积分';
|
COMMENT ON COLUMN user_market_package_info.amount_total IS '总产出福利积分';
|
||||||
COMMENT ON COLUMN package_info.give_amount IS '购买赠与福利值';
|
COMMENT ON COLUMN user_market_package_info.give_amount IS '购买赠与福利值';
|
||||||
COMMENT ON COLUMN package_info.bonus IS '激活比率';
|
COMMENT ON COLUMN user_market_package_info.bonus IS '激活比率';
|
||||||
COMMENT ON COLUMN package_info.user_benefit IS '兑换包需要的福利积分';
|
COMMENT ON COLUMN user_market_package_info.user_benefit IS '兑换包需要的福利积分';
|
||||||
COMMENT ON COLUMN package_info.user_cash IS '兑换包需要的现金券';
|
COMMENT ON COLUMN user_market_package_info.user_cash IS '兑换包需要的现金券';
|
||||||
COMMENT ON COLUMN package_info.is_need_benefit IS '是否需要福利积分 0-否 1-是';
|
COMMENT ON COLUMN user_market_package_info.is_need_benefit IS '是否需要福利积分 0-否 1-是';
|
||||||
COMMENT ON COLUMN package_info.is_need_cash IS '是否需要现金券 0-否 1-是';
|
COMMENT ON COLUMN user_market_package_info.is_need_cash IS '是否需要现金券 0-否 1-是';
|
||||||
COMMENT ON COLUMN package_info.max_exchange_qty IS '全网最大兑换数量';
|
COMMENT ON COLUMN user_market_package_info.max_exchange_qty IS '全网最大兑换数量';
|
||||||
COMMENT ON COLUMN package_info.exchanged_qty IS '已兑换数量';
|
COMMENT ON COLUMN user_market_package_info.exchanged_qty IS '已兑换数量';
|
||||||
comment on column package_info.create_user is '创建人';
|
comment on column user_market_package_info.create_user is '创建人';
|
||||||
comment on column package_info.create_dept is '创建部门';
|
comment on column user_market_package_info.create_dept is '创建部门';
|
||||||
comment on column package_info.create_time is '创建时间';
|
comment on column user_market_package_info.create_time is '创建时间';
|
||||||
comment on column package_info.update_user is '修改人';
|
comment on column user_market_package_info.update_user is '修改人';
|
||||||
comment on column package_info.update_time is '修改时间';
|
comment on column user_market_package_info.update_time is '修改时间';
|
||||||
comment on column package_info.status is '状态';
|
comment on column user_market_package_info.status is '状态';
|
||||||
comment on column package_info.is_deleted is '是否已删除';
|
comment on column user_market_package_info.is_deleted is '是否已删除';
|
||||||
|
|
||||||
alter table package_info
|
alter table user_market_package_info
|
||||||
owner to yicha1lu;
|
owner to yicha1lu;
|
||||||
|
|
||||||
create table give_pack_log
|
|
||||||
(
|
|
||||||
id int8 not null primary key,
|
|
||||||
statistical_date timestamp(6),
|
|
||||||
user_id int8,
|
|
||||||
phone int8,
|
|
||||||
user_name varchar(128),
|
|
||||||
package_id int8,
|
|
||||||
package_name varchar(128),
|
|
||||||
package_detail text,
|
|
||||||
give_number int4 default 1,
|
|
||||||
remark text,
|
|
||||||
create_user int8,
|
|
||||||
create_dept int8,
|
|
||||||
create_time timestamp(6),
|
|
||||||
update_user int8,
|
|
||||||
update_time timestamp(6),
|
|
||||||
status int4 default 1,
|
|
||||||
is_deleted int4 default 0
|
|
||||||
);
|
|
||||||
|
|
||||||
|
create table user_market_benefit_package --用户福利积分包表
|
||||||
create index gpl_date_index
|
|
||||||
on give_pack_log (is_deleted, statistical_date ,user_id);
|
|
||||||
|
|
||||||
|
|
||||||
COMMENT ON TABLE give_pack_log IS '划拨积分记录';
|
|
||||||
COMMENT ON COLUMN give_pack_log.id IS '主键';
|
|
||||||
COMMENT ON COLUMN give_pack_log.statistical_date IS '统计日期';
|
|
||||||
COMMENT ON COLUMN give_pack_log.user_id IS '用户id';
|
|
||||||
COMMENT ON COLUMN give_pack_log.phone IS '用户手机号';
|
|
||||||
COMMENT ON COLUMN give_pack_log.user_name IS '用户名';
|
|
||||||
COMMENT ON COLUMN give_pack_log.package_id IS '积分包id';
|
|
||||||
COMMENT ON COLUMN give_pack_log.package_name IS '积分包名称';
|
|
||||||
COMMENT ON COLUMN give_pack_log.package_detail IS '积分包信息快照';
|
|
||||||
COMMENT ON COLUMN give_pack_log.give_number IS '赠送数量';
|
|
||||||
COMMENT ON COLUMN give_pack_log.remark IS '备注';
|
|
||||||
comment on column give_pack_log.create_user is '创建人';
|
|
||||||
comment on column give_pack_log.create_dept is '创建部门';
|
|
||||||
comment on column give_pack_log.create_time is '创建时间';
|
|
||||||
comment on column give_pack_log.update_user is '修改人';
|
|
||||||
comment on column give_pack_log.update_time is '修改时间';
|
|
||||||
comment on column give_pack_log.status is '状态';
|
|
||||||
comment on column give_pack_log.is_deleted is '是否已删除';
|
|
||||||
|
|
||||||
alter table give_pack_log
|
|
||||||
owner to yicha1lu;
|
|
||||||
|
|
||||||
create table user_package_info
|
|
||||||
(
|
(
|
||||||
id int8 not null primary key,
|
id int8 not null primary key,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
@@ -130,15 +85,14 @@ create table user_package_info
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
create index upi_complete_index
|
create index upi_complete_index
|
||||||
on user_package_info (is_deleted, user_id , is_complete , is_expired);
|
on user_package_info (is_deleted, user_id, is_complete, is_expired);
|
||||||
|
|
||||||
create index upi_date_index
|
create index upi_date_index
|
||||||
on user_package_info (is_deleted, statistical_date ,user_id);
|
on user_package_info (is_deleted, statistical_date, user_id);
|
||||||
|
|
||||||
create index upi_expired_index
|
create index upi_expired_index
|
||||||
on user_package_info (is_deleted, expired_date ,is_expired);
|
on user_package_info (is_deleted, expired_date, is_expired);
|
||||||
|
|
||||||
COMMENT ON TABLE user_package_info IS '用户积分包信息表';
|
COMMENT ON TABLE user_package_info IS '用户积分包信息表';
|
||||||
COMMENT ON COLUMN user_package_info.id IS '主键';
|
COMMENT ON COLUMN user_package_info.id IS '主键';
|
||||||
@@ -171,6 +125,56 @@ comment on column user_package_info.is_deleted is '是否已删除';
|
|||||||
alter table user_package_info
|
alter table user_package_info
|
||||||
owner to yicha1lu;
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
create table give_pack_log
|
||||||
|
(
|
||||||
|
id int8 not null primary key,
|
||||||
|
statistical_date timestamp(6),
|
||||||
|
user_id int8,
|
||||||
|
phone int8,
|
||||||
|
user_name varchar(128),
|
||||||
|
package_id int8,
|
||||||
|
package_name varchar(128),
|
||||||
|
package_detail text,
|
||||||
|
give_number int4 default 1,
|
||||||
|
remark text,
|
||||||
|
create_user int8,
|
||||||
|
create_dept int8,
|
||||||
|
create_time timestamp(6),
|
||||||
|
update_user int8,
|
||||||
|
update_time timestamp(6),
|
||||||
|
status int4 default 1,
|
||||||
|
is_deleted int4 default 0
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
create index gpl_date_index
|
||||||
|
on give_pack_log (is_deleted, statistical_date, user_id);
|
||||||
|
|
||||||
|
|
||||||
|
COMMENT ON TABLE give_pack_log IS '划拨积分记录';
|
||||||
|
COMMENT ON COLUMN give_pack_log.id IS '主键';
|
||||||
|
COMMENT ON COLUMN give_pack_log.statistical_date IS '统计日期';
|
||||||
|
COMMENT ON COLUMN give_pack_log.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN give_pack_log.phone IS '用户手机号';
|
||||||
|
COMMENT ON COLUMN give_pack_log.user_name IS '用户名';
|
||||||
|
COMMENT ON COLUMN give_pack_log.package_id IS '积分包id';
|
||||||
|
COMMENT ON COLUMN give_pack_log.package_name IS '积分包名称';
|
||||||
|
COMMENT ON COLUMN give_pack_log.package_detail IS '积分包信息快照';
|
||||||
|
COMMENT ON COLUMN give_pack_log.give_number IS '赠送数量';
|
||||||
|
COMMENT ON COLUMN give_pack_log.remark IS '备注';
|
||||||
|
comment on column give_pack_log.create_user is '创建人';
|
||||||
|
comment on column give_pack_log.create_dept is '创建部门';
|
||||||
|
comment on column give_pack_log.create_time is '创建时间';
|
||||||
|
comment on column give_pack_log.update_user is '修改人';
|
||||||
|
comment on column give_pack_log.update_time is '修改时间';
|
||||||
|
comment on column give_pack_log.status is '状态';
|
||||||
|
comment on column give_pack_log.is_deleted is '是否已删除';
|
||||||
|
|
||||||
|
alter table give_pack_log
|
||||||
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
create table user_package_info_copy
|
create table user_package_info_copy
|
||||||
@@ -216,11 +220,11 @@ create table user_package_info_copy
|
|||||||
|
|
||||||
);
|
);
|
||||||
create index upi_copy_complete_index
|
create index upi_copy_complete_index
|
||||||
on user_package_info_copy (is_deleted, is_complete , is_expired ,user_id );
|
on user_package_info_copy (is_deleted, is_complete, is_expired, user_id);
|
||||||
create index upi_copy_date_index
|
create index upi_copy_date_index
|
||||||
on user_package_info_copy (is_deleted, statistical_date ,user_id);
|
on user_package_info_copy (is_deleted, statistical_date, user_id);
|
||||||
create index upi_copy_expired_index
|
create index upi_copy_expired_index
|
||||||
on user_package_info_copy (is_deleted, expired_date ,is_expired);
|
on user_package_info_copy (is_deleted, expired_date, is_expired);
|
||||||
|
|
||||||
COMMENT ON TABLE user_package_info_copy IS '用户积分包信息-副本表';
|
COMMENT ON TABLE user_package_info_copy IS '用户积分包信息-副本表';
|
||||||
COMMENT ON COLUMN user_package_info_copy.id IS '主键';
|
COMMENT ON COLUMN user_package_info_copy.id IS '主键';
|
||||||
@@ -316,7 +320,7 @@ create table user_benefit_log
|
|||||||
|
|
||||||
);
|
);
|
||||||
create index ub_log_date_index
|
create index ub_log_date_index
|
||||||
on user_benefit_log (is_deleted, user_id , statistical_date , type);
|
on user_benefit_log (is_deleted, user_id, statistical_date, type);
|
||||||
|
|
||||||
comment on table user_benefit_log is '用户福利值流水表';
|
comment on table user_benefit_log is '用户福利值流水表';
|
||||||
comment on column user_benefit_log.id is '主键';
|
comment on column user_benefit_log.id is '主键';
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
CREATE TABLE mall_spu
|
CREATE TABLE mall_product
|
||||||
(
|
(
|
||||||
id int8 NOT NULL PRIMARY KEY,
|
id int8 NOT NULL PRIMARY KEY,
|
||||||
spu_sn VARCHAR(255) DEFAULT '' NOT NULL,
|
spu_sn VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
|
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
main_img VARCHAR(255) DEFAULT '' NOT NULL,
|
main_img VARCHAR(255) DEFAULT '' NOT NULL, --缩略图
|
||||||
detail_img text NULL,
|
detail_img text NULL, --详情图
|
||||||
top_img text NULL,
|
top_img text NULL, -- 详情页顶图
|
||||||
cate_id VARCHAR(255) DEFAULT '' NOT NULL,
|
cate_id VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
cate_ids VARCHAR(255) DEFAULT '' NOT NULL,
|
cate_ids VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
@@ -24,7 +24,7 @@ CREATE TABLE mall_spu
|
|||||||
is_deleted int4 DEFAULT 0 NULL
|
is_deleted int4 DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- 缺规格 运费
|
||||||
COMMENT ON TABLE mall_spu IS '商城spu';
|
COMMENT ON TABLE mall_spu IS '商城spu';
|
||||||
COMMENT ON COLUMN mall_spu.id IS '主键';
|
COMMENT ON COLUMN mall_spu.id IS '主键';
|
||||||
COMMENT ON COLUMN mall_spu.spu_sn IS '商品编码';
|
COMMENT ON COLUMN mall_spu.spu_sn IS '商品编码';
|
||||||
@@ -52,6 +52,7 @@ alter table mall_spu
|
|||||||
owner to yicha1lu;
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
|
||||||
|
-- 缺图片
|
||||||
CREATE TABLE spu_category
|
CREATE TABLE spu_category
|
||||||
(
|
(
|
||||||
id int8 NOT NULL PRIMARY KEY,
|
id int8 NOT NULL PRIMARY KEY,
|
||||||
@@ -86,6 +87,7 @@ COMMENT ON COLUMN spu_category.create_dept IS '创建部门';
|
|||||||
alter table spu_category
|
alter table spu_category
|
||||||
owner to yicha1lu;
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
--改成全局购物车
|
||||||
CREATE TABLE mall_cart
|
CREATE TABLE mall_cart
|
||||||
(
|
(
|
||||||
id int8 NOT NULL PRIMARY KEY,
|
id int8 NOT NULL PRIMARY KEY,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
-- 阔一张业务属性的地理信息
|
||||||
CREATE TABLE regions_info
|
CREATE TABLE regions_info
|
||||||
(
|
(
|
||||||
id int4 PRIMARY KEY,
|
id int4 PRIMARY KEY,
|
||||||
|
|||||||
Reference in New Issue
Block a user