修改 sql 遗留字段名称

This commit is contained in:
2025-04-08 14:54:43 +08:00
parent e1c4bb5c03
commit c02d843dbc

View File

@@ -618,8 +618,8 @@ create table resource_pss (
on delete cascade, on delete cascade,
type int, type int,
live int, live int,
quota int,
expire timestamp, expire timestamp,
quota int,
used int not null default 0, used int not null default 0,
daily_limit int not null default 0, daily_limit int not null default 0,
daily_used int not null default 0, daily_used int not null default 0,
@@ -748,7 +748,7 @@ comment on column trade.deleted_at is '删除时间';
drop table if exists bill cascade; drop table if exists bill cascade;
create table bill ( create table bill (
id serial primary key, id serial primary key,
order_id int not null references trade (id) trade_id int not null references trade (id)
on update cascade on update cascade
on delete cascade, on delete cascade,
user_id int not null references "user" (id) user_id int not null references "user" (id)
@@ -766,14 +766,14 @@ create table bill (
updated_at timestamp default current_timestamp, updated_at timestamp default current_timestamp,
deleted_at timestamp deleted_at timestamp
); );
create index bill_order_id_index on bill (order_id); create index bill_trade_id_index on bill (trade_id);
create index bill_product_id_index on bill (product_id); create index bill_product_id_index on bill (product_id);
create index bill_deleted_at_index on bill (deleted_at); create index bill_deleted_at_index on bill (deleted_at);
-- bill表字段注释 -- bill表字段注释
comment on table bill is '账单表'; comment on table bill is '账单表';
comment on column bill.id is '账单ID'; comment on column bill.id is '账单ID';
comment on column bill.order_id is '订单ID'; comment on column bill.trade_id is '订单ID';
comment on column bill.user_id is '用户ID'; comment on column bill.user_id is '用户ID';
comment on column bill.product_id is '产品ID'; comment on column bill.product_id is '产品ID';
comment on column bill.info is '产品可读信息'; comment on column bill.info is '产品可读信息';
@@ -789,7 +789,7 @@ comment on column bill.deleted_at is '删除时间';
drop table if exists refund cascade; drop table if exists refund cascade;
create table refund ( create table refund (
id serial primary key, id serial primary key,
order_id int not null references trade (id) trade_id int not null references trade (id)
on update cascade on update cascade
on delete cascade, on delete cascade,
product_id int references product (id) -- product_id int references product (id) --
@@ -800,14 +800,14 @@ create table refund (
updated_at timestamp default current_timestamp, updated_at timestamp default current_timestamp,
deleted_at timestamp deleted_at timestamp
); );
create index refund_order_id_index on refund (order_id); create index refund_trade_id_index on refund (trade_id);
create index refund_product_id_index on refund (product_id); create index refund_product_id_index on refund (product_id);
create index refund_deleted_at_index on refund (deleted_at); create index refund_deleted_at_index on refund (deleted_at);
-- refund表字段注释 -- refund表字段注释
comment on table refund is '退款记录表'; comment on table refund is '退款记录表';
comment on column refund.id is '退款ID'; comment on column refund.id is '退款ID';
comment on column refund.order_id is '订单ID'; comment on column refund.trade_id is '订单ID';
comment on column refund.product_id is '产品ID'; comment on column refund.product_id is '产品ID';
comment on column refund.amount is '退款金额'; comment on column refund.amount is '退款金额';
comment on column refund.created_at is '创建时间'; comment on column refund.created_at is '创建时间';