实现用户咨询数据收集接口
This commit is contained in:
@@ -108,6 +108,76 @@ comment on column logs_user_bandwidth.time is '记录时间';
|
||||
|
||||
-- endregion
|
||||
|
||||
-- ====================
|
||||
-- region 系统信息
|
||||
-- ====================
|
||||
|
||||
-- announcement
|
||||
drop table if exists announcement cascade;
|
||||
create table announcement (
|
||||
id int generated by default as identity primary key,
|
||||
title text not null,
|
||||
content text,
|
||||
type int not null default 1,
|
||||
pin bool not null default false,
|
||||
status int not null default 1,
|
||||
sort int not null default 0,
|
||||
created_at timestamptz default current_timestamp,
|
||||
updated_at timestamptz default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
);
|
||||
create index idx_announcement_type on announcement (type) where deleted_at is null;
|
||||
create index idx_announcement_pin on announcement (pin) where deleted_at is null;
|
||||
create index idx_announcement_created_at on announcement (created_at) where deleted_at is null;
|
||||
|
||||
-- announcement表字段注释
|
||||
comment on table announcement is '公告表';
|
||||
comment on column announcement.id is '公告ID';
|
||||
comment on column announcement.title is '公告标题';
|
||||
comment on column announcement.content is '公告内容';
|
||||
comment on column announcement.type is '公告类型:1-普通公告';
|
||||
comment on column announcement.status is '公告状态:0-禁用,1-正常';
|
||||
comment on column announcement.pin is '是否置顶';
|
||||
comment on column announcement.sort is '公告排序';
|
||||
comment on column announcement.created_at is '创建时间';
|
||||
comment on column announcement.updated_at is '更新时间';
|
||||
comment on column announcement.deleted_at is '删除时间';
|
||||
|
||||
-- inquiry
|
||||
drop table if exists inquiry cascade;
|
||||
create table inquiry (
|
||||
id int generated by default as identity primary key,
|
||||
company text,
|
||||
name text,
|
||||
phone text,
|
||||
email text,
|
||||
content text,
|
||||
status int not null default 0,
|
||||
remark text,
|
||||
created_at timestamptz default current_timestamp,
|
||||
updated_at timestamptz default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
);
|
||||
create index idx_inquiry_phone on inquiry (phone) where deleted_at is null;
|
||||
create index idx_inquiry_status on inquiry (status) where deleted_at is null;
|
||||
create index idx_inquiry_created_at on inquiry (created_at) where deleted_at is null;
|
||||
|
||||
-- inquiry表字段注释
|
||||
comment on table inquiry is '用户咨询表';
|
||||
comment on column inquiry.id is '咨询ID';
|
||||
comment on column inquiry.name is '联系人姓名';
|
||||
comment on column inquiry.phone is '联系电话';
|
||||
comment on column inquiry.email is '联系邮箱';
|
||||
comment on column inquiry.company is '公司名称';
|
||||
comment on column inquiry.content is '咨询内容';
|
||||
comment on column inquiry.status is '处理状态:0-待处理,1-已处理';
|
||||
comment on column inquiry.remark is '备注';
|
||||
comment on column inquiry.created_at is '创建时间';
|
||||
comment on column inquiry.updated_at is '更新时间';
|
||||
comment on column inquiry.deleted_at is '删除时间';
|
||||
|
||||
-- endregion
|
||||
|
||||
-- ====================
|
||||
-- region 管理员信息
|
||||
-- ====================
|
||||
@@ -177,37 +247,6 @@ comment on column admin_role.created_at is '创建时间';
|
||||
comment on column admin_role.updated_at is '更新时间';
|
||||
comment on column admin_role.deleted_at is '删除时间';
|
||||
|
||||
-- announcement
|
||||
drop table if exists announcement cascade;
|
||||
create table announcement (
|
||||
id int generated by default as identity primary key,
|
||||
title text not null,
|
||||
content text,
|
||||
type int not null default 1,
|
||||
pin bool not null default false,
|
||||
status int not null default 1,
|
||||
sort int not null default 0,
|
||||
created_at timestamptz default current_timestamp,
|
||||
updated_at timestamptz default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
);
|
||||
create index idx_announcement_type on announcement (type) where deleted_at is null;
|
||||
create index idx_announcement_pin on announcement (pin) where deleted_at is null;
|
||||
create index idx_announcement_created_at on announcement (created_at) where deleted_at is null;
|
||||
|
||||
-- announcement表字段注释
|
||||
comment on table announcement is '公告表';
|
||||
comment on column announcement.id is '公告ID';
|
||||
comment on column announcement.title is '公告标题';
|
||||
comment on column announcement.content is '公告内容';
|
||||
comment on column announcement.type is '公告类型:1-普通公告';
|
||||
comment on column announcement.status is '公告状态:0-禁用,1-正常';
|
||||
comment on column announcement.pin is '是否置顶';
|
||||
comment on column announcement.sort is '公告排序';
|
||||
comment on column announcement.created_at is '创建时间';
|
||||
comment on column announcement.updated_at is '更新时间';
|
||||
comment on column announcement.deleted_at is '删除时间';
|
||||
|
||||
-- endregion
|
||||
|
||||
-- ====================
|
||||
|
||||
Reference in New Issue
Block a user