Merge remote-tracking branch 'origin/main'
This commit is contained in:
249
doc/sql/pending/user_point.sql
Normal file
249
doc/sql/pending/user_point.sql
Normal file
@@ -0,0 +1,249 @@
|
||||
--- 福利积分 benefit_point
|
||||
DROP TABLE IF EXISTS benefit_point;
|
||||
create table benefit_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
comment on table benefit_point is '用户福利值表';
|
||||
comment on column benefit_point.id is '主键';
|
||||
comment on column benefit_point.amount is '金额';
|
||||
comment on column benefit_point.version is '版本号';
|
||||
comment on column benefit_point.create_user is '创建人';
|
||||
comment on column benefit_point.create_dept is '创建部门';
|
||||
comment on column benefit_point.create_time is '创建时间';
|
||||
comment on column benefit_point.update_user is '修改人';
|
||||
comment on column benefit_point.update_time is '修改时间';
|
||||
comment on column benefit_point.status is '状态';
|
||||
comment on column benefit_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table benefit_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS benefit_point_log;
|
||||
create table benefit_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
user_phone int8,
|
||||
user_name varchar(128),
|
||||
amount decimal(14, 2) default 0,
|
||||
source_id int8,
|
||||
user_pack_id int8,
|
||||
source_detail text,
|
||||
order_id int8,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
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 inx_umbl_uid
|
||||
on benefit_point_log (is_complete, user_id , statistical_date , type);
|
||||
|
||||
comment on table benefit_point_log is '用户福利值流水表';
|
||||
comment on column benefit_point_log.id is '主键';
|
||||
comment on column benefit_point_log.user_id is '用户id';
|
||||
comment on column benefit_point_log.user_phone is '用户手机号';
|
||||
comment on column benefit_point_log.user_name is '用户名称';
|
||||
comment on column benefit_point_log.amount is '金额';
|
||||
comment on column benefit_point_log.source_id is '来源id';
|
||||
comment on column benefit_point_log.user_pack_id is '用户积分包id';
|
||||
comment on column benefit_point_log.source_detail is '来源详情';
|
||||
comment on column benefit_point_log.order_id is '订单id';
|
||||
comment on column benefit_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column benefit_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column benefit_point_log.statistical_date is '统计时间';
|
||||
comment on column benefit_point_log.remark is '备注';
|
||||
comment on column benefit_point_log.create_user is '创建人';
|
||||
comment on column benefit_point_log.create_dept is '创建部门';
|
||||
comment on column benefit_point_log.create_time is '创建时间';
|
||||
comment on column benefit_point_log.update_user is '修改人';
|
||||
comment on column benefit_point_log.update_time is '修改时间';
|
||||
comment on column benefit_point_log.status is '状态';
|
||||
comment on column benefit_point_log.is_deleted is '是否已删除';
|
||||
alter table benefit_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 现金券 cash_coupon
|
||||
DROP TABLE IF EXISTS cash_coupon;
|
||||
create table cash_coupon
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
comment on table cash_coupon is '用户现金券表';
|
||||
comment on column cash_coupon.id is '主键';
|
||||
comment on column cash_coupon.amount is '面额';
|
||||
comment on column cash_coupon.version is '版本号';
|
||||
comment on column cash_coupon.create_user is '创建人';
|
||||
comment on column cash_coupon.create_dept is '创建部门';
|
||||
comment on column cash_coupon.create_time is '创建时间';
|
||||
comment on column cash_coupon.update_user is '修改人';
|
||||
comment on column cash_coupon.update_time is '修改时间';
|
||||
comment on column cash_coupon.status is '状态';
|
||||
comment on column cash_coupon.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS cash_coupon_log;
|
||||
create table cash_coupon_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
user_phone int8,
|
||||
user_name varchar(128),
|
||||
amount decimal(14, 2) default 0,
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
order_id int8,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
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 inx_umcl_uid
|
||||
on cash_coupon_log (is_complete, user_id , statistical_date , type);
|
||||
|
||||
comment on table cash_coupon_log is '用户现金券流水表';
|
||||
comment on column cash_coupon_log.id is '主键';
|
||||
comment on column cash_coupon_log.user_id is '用户id';
|
||||
comment on column cash_coupon_log.user_phone is '用户手机号';
|
||||
comment on column cash_coupon_log.user_name is '用户名称';
|
||||
comment on column cash_coupon_log.amount is '金额';
|
||||
comment on column cash_coupon_log.source_id is '来源id';
|
||||
comment on column cash_coupon_log.source_detail is '来源详情';
|
||||
comment on column cash_coupon_log.order_id is '订单id';
|
||||
comment on column cash_coupon_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column cash_coupon_log.statistical_date is '统计时间';
|
||||
comment on column cash_coupon_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column cash_coupon_log.remark is '备注';
|
||||
comment on column cash_coupon_log.create_user is '创建人';
|
||||
comment on column cash_coupon_log.create_dept is '创建部门';
|
||||
comment on column cash_coupon_log.create_time is '创建时间';
|
||||
comment on column cash_coupon_log.update_user is '修改人';
|
||||
comment on column cash_coupon_log.update_time is '修改时间';
|
||||
comment on column cash_coupon_log.status is '状态';
|
||||
comment on column cash_coupon_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 用户积分 user_point
|
||||
DROP TABLE IF EXISTS user_point;
|
||||
create table user_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
comment on table user_point is '用户商城积分表';
|
||||
comment on column user_point.amount is '面额';
|
||||
comment on column user_point.version is '版本号';
|
||||
comment on column user_point.create_user is '创建人';
|
||||
comment on column user_point.create_dept is '创建部门';
|
||||
comment on column user_point.create_time is '创建时间';
|
||||
comment on column user_point.update_user is '修改人';
|
||||
comment on column user_point.update_time is '修改时间';
|
||||
comment on column user_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS user_point_log;
|
||||
create table user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
user_phone int8,
|
||||
user_name varchar(128),
|
||||
amount decimal(14, 2) default 0,
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
order_id int8,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
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 inx_uapl_uid
|
||||
on user_point_log (is_complete, user_id , statistical_date , type);
|
||||
|
||||
comment on table user_point_log is '用户商城积分流水表';
|
||||
comment on column user_point_log.id is '主键';
|
||||
comment on column user_point_log.user_id is '用户id';
|
||||
comment on column user_point_log.user_phone is '用户手机号';
|
||||
comment on column user_point_log.user_name is '用户名称';
|
||||
comment on column user_point_log.amount is '金额';
|
||||
comment on column user_point_log.source_id is '来源id';
|
||||
comment on column user_point_log.source_detail is '来源详情';
|
||||
comment on column user_point_log.order_id is '订单id';
|
||||
comment on column user_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column user_point_log.statistical_date is '统计时间';
|
||||
comment on column user_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column user_point_log.remark is '备注';
|
||||
comment on column user_point_log.create_user is '创建人';
|
||||
comment on column user_point_log.create_dept is '创建部门';
|
||||
comment on column user_point_log.create_time is '创建时间';
|
||||
comment on column user_point_log.update_user is '修改人';
|
||||
comment on column user_point_log.update_time is '修改时间';
|
||||
comment on column user_point_log.status is '状态';
|
||||
comment on column user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
Reference in New Issue
Block a user