福利积分, 现金券, 商城积分, 以及流水
This commit is contained in:
244
doc/sql/pending/user_point.sql
Normal file
244
doc/sql/pending/user_point.sql
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
DROP TABLE IF EXISTS user_market_benefit;
|
||||||
|
create table user_market_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 user_market_benefit_point is '用户福利值表';
|
||||||
|
comment on column user_market_benefit_point.id is '主键';
|
||||||
|
comment on column user_market_benefit_point.amount is '金额';
|
||||||
|
comment on column user_market_benefit_point.version is '版本号';
|
||||||
|
comment on column user_market_benefit_point.create_user is '创建人';
|
||||||
|
comment on column user_market_benefit_point.create_dept is '创建部门';
|
||||||
|
comment on column user_market_benefit_point.create_time is '创建时间';
|
||||||
|
comment on column user_market_benefit_point.update_user is '修改人';
|
||||||
|
comment on column user_market_benefit_point.update_time is '修改时间';
|
||||||
|
comment on column user_market_benefit_point.status is '状态';
|
||||||
|
comment on column user_market_benefit_point.is_deleted is '是否已删除';
|
||||||
|
|
||||||
|
alter table user_market_benefit_point
|
||||||
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS user_market_benefit_point_log;
|
||||||
|
create table user_market_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 user_market_benefit_point_log (is_complete, user_id , statistical_date , type);
|
||||||
|
|
||||||
|
comment on table user_market_benefit_point_log is '用户福利值流水表';
|
||||||
|
comment on column user_market_benefit_point_log.id is '主键';
|
||||||
|
comment on column user_market_benefit_point_log.user_id is '用户id';
|
||||||
|
comment on column user_market_benefit_point_log.user_phone is '用户手机号';
|
||||||
|
comment on column user_market_benefit_point_log.user_name is '用户名称';
|
||||||
|
comment on column user_market_benefit_point_log.amount is '金额';
|
||||||
|
comment on column user_market_benefit_point_log.source_id is '来源id';
|
||||||
|
comment on column user_market_benefit_point_log.user_pack_id is '用户积分包id';
|
||||||
|
comment on column user_market_benefit_point_log.source_detail is '来源详情';
|
||||||
|
comment on column user_market_benefit_point_log.order_id is '订单id';
|
||||||
|
comment on column user_market_benefit_point_log.type is '消费类型 1-收入 2-支出';
|
||||||
|
comment on column user_market_benefit_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||||
|
comment on column user_market_benefit_point_log.statistical_date is '统计时间';
|
||||||
|
comment on column user_market_benefit_point_log.remark is '备注';
|
||||||
|
comment on column user_market_benefit_point_log.create_user is '创建人';
|
||||||
|
comment on column user_market_benefit_point_log.create_dept is '创建部门';
|
||||||
|
comment on column user_market_benefit_point_log.create_time is '创建时间';
|
||||||
|
comment on column user_market_benefit_point_log.update_user is '修改人';
|
||||||
|
comment on column user_market_benefit_point_log.update_time is '修改时间';
|
||||||
|
comment on column user_market_benefit_point_log.status is '状态';
|
||||||
|
comment on column user_market_benefit_point_log.is_deleted is '是否已删除';
|
||||||
|
alter table user_market_benefit_point_log
|
||||||
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS user_market_cash_point;
|
||||||
|
create table user_market_cash_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_market_cash_point is '用户现金券表';
|
||||||
|
comment on column user_market_cash_point.id is '主键';
|
||||||
|
comment on column user_market_cash_point.amount is '面额';
|
||||||
|
comment on column user_market_cash_point.version is '版本号';
|
||||||
|
comment on column user_market_cash_point.create_user is '创建人';
|
||||||
|
comment on column user_market_cash_point.create_dept is '创建部门';
|
||||||
|
comment on column user_market_cash_point.create_time is '创建时间';
|
||||||
|
comment on column user_market_cash_point.update_user is '修改人';
|
||||||
|
comment on column user_market_cash_point.update_time is '修改时间';
|
||||||
|
comment on column user_market_cash_point.status is '状态';
|
||||||
|
comment on column user_market_cash_point.is_deleted is '是否已删除';
|
||||||
|
|
||||||
|
alter table user_market_cash_point
|
||||||
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS user_market_cash_point_log;
|
||||||
|
create table user_market_cash_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_umcl_uid
|
||||||
|
on user_market_cash_point_log (is_complete, user_id , statistical_date , type);
|
||||||
|
|
||||||
|
comment on table user_market_cash_point_log is '用户现金券流水表';
|
||||||
|
comment on column user_market_cash_point_log.id is '主键';
|
||||||
|
comment on column user_market_cash_point_log.user_id is '用户id';
|
||||||
|
comment on column user_market_cash_point_log.user_phone is '用户手机号';
|
||||||
|
comment on column user_market_cash_point_log.user_name is '用户名称';
|
||||||
|
comment on column user_market_cash_point_log.amount is '金额';
|
||||||
|
comment on column user_market_cash_point_log.source_id is '来源id';
|
||||||
|
comment on column user_market_cash_point_log.source_detail is '来源详情';
|
||||||
|
comment on column user_market_cash_point_log.order_id is '订单id';
|
||||||
|
comment on column user_market_cash_point_log.type is '消费类型 1-收入 2-支出';
|
||||||
|
comment on column user_market_cash_point_log.statistical_date is '统计时间';
|
||||||
|
comment on column user_market_cash_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||||
|
comment on column user_market_cash_point_log.remark is '备注';
|
||||||
|
comment on column user_market_cash_point_log.create_user is '创建人';
|
||||||
|
comment on column user_market_cash_point_log.create_dept is '创建部门';
|
||||||
|
comment on column user_market_cash_point_log.create_time is '创建时间';
|
||||||
|
comment on column user_market_cash_point_log.update_user is '修改人';
|
||||||
|
comment on column user_market_cash_point_log.update_time is '修改时间';
|
||||||
|
comment on column user_market_cash_point_log.status is '状态';
|
||||||
|
comment on column user_market_cash_point_log.is_deleted is '是否已删除';
|
||||||
|
|
||||||
|
alter table user_market_cash_point_log
|
||||||
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS user_app_mall_point;
|
||||||
|
create table user_app_mall_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_app_mall_point is '用户商城积分表';
|
||||||
|
comment on column user_app_mall_point.amount is '面额';
|
||||||
|
comment on column user_app_mall_point.version is '版本号';
|
||||||
|
comment on column user_app_mall_point.create_user is '创建人';
|
||||||
|
comment on column user_app_mall_point.create_dept is '创建部门';
|
||||||
|
comment on column user_app_mall_point.create_time is '创建时间';
|
||||||
|
comment on column user_app_mall_point.update_user is '修改人';
|
||||||
|
comment on column user_app_mall_point.update_time is '修改时间';
|
||||||
|
comment on column user_app_mall_point.is_deleted is '是否已删除';
|
||||||
|
|
||||||
|
alter table user_app_mall_point
|
||||||
|
owner to yicha1lu;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS user_app_mall_point_log;
|
||||||
|
create table user_app_mall_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_app_mall_point_log (is_complete, user_id , statistical_date , type);
|
||||||
|
|
||||||
|
comment on table user_app_mall_point_log is '用户商城积分流水表';
|
||||||
|
comment on column user_app_mall_point_log.id is '主键';
|
||||||
|
comment on column user_app_mall_point_log.user_id is '用户id';
|
||||||
|
comment on column user_app_mall_point_log.user_phone is '用户手机号';
|
||||||
|
comment on column user_app_mall_point_log.user_name is '用户名称';
|
||||||
|
comment on column user_app_mall_point_log.amount is '金额';
|
||||||
|
comment on column user_app_mall_point_log.source_id is '来源id';
|
||||||
|
comment on column user_app_mall_point_log.source_detail is '来源详情';
|
||||||
|
comment on column user_app_mall_point_log.order_id is '订单id';
|
||||||
|
comment on column user_app_mall_point_log.type is '消费类型 1-收入 2-支出';
|
||||||
|
comment on column user_app_mall_point_log.statistical_date is '统计时间';
|
||||||
|
comment on column user_app_mall_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||||
|
comment on column user_app_mall_point_log.remark is '备注';
|
||||||
|
comment on column user_app_mall_point_log.create_user is '创建人';
|
||||||
|
comment on column user_app_mall_point_log.create_dept is '创建部门';
|
||||||
|
comment on column user_app_mall_point_log.create_time is '创建时间';
|
||||||
|
comment on column user_app_mall_point_log.update_user is '修改人';
|
||||||
|
comment on column user_app_mall_point_log.update_time is '修改时间';
|
||||||
|
comment on column user_app_mall_point_log.status is '状态';
|
||||||
|
comment on column user_app_mall_point_log.is_deleted is '是否已删除';
|
||||||
|
|
||||||
|
alter table user_app_mall_point_log
|
||||||
|
owner to yicha1lu;
|
||||||
|
|
||||||
Reference in New Issue
Block a user