|
@@ -1,10 +1,4 @@
|
|
|
-
|
|
|
-
|
|
|
--- public.log_error definition
|
|
|
-
|
|
|
--- Drop table
|
|
|
-
|
|
|
--- DROP TABLE log_error;
|
|
|
+DROP TABLE IF EXISTS log_error;
|
|
|
|
|
|
CREATE TABLE log_error (
|
|
|
id bigserial PRIMARY KEY, -- 主键
|
|
@@ -15,15 +9,15 @@ CREATE TABLE log_error (
|
|
|
create_time timestamp(0) DEFAULT now() NULL -- 创建时间
|
|
|
);
|
|
|
|
|
|
-COMMENT ON COLUMN public.log_error.id IS '主键';
|
|
|
-COMMENT ON COLUMN public.log_error."exception" IS '异常';
|
|
|
-COMMENT ON COLUMN public.log_error.message IS '异常消息';
|
|
|
-COMMENT ON COLUMN public.log_error.error_info IS '异常详细消息';
|
|
|
-COMMENT ON COLUMN public.log_error.error_stack_trace IS '异常堆栈';
|
|
|
-COMMENT ON COLUMN public.log_error.create_time IS '创建时间';
|
|
|
+COMMENT ON COLUMN log_error.id IS '主键';
|
|
|
+COMMENT ON COLUMN log_error."exception" IS '异常';
|
|
|
+COMMENT ON COLUMN log_error.message IS '异常消息';
|
|
|
+COMMENT ON COLUMN log_error.error_info IS '异常详细消息';
|
|
|
+COMMENT ON COLUMN log_error.error_stack_trace IS '异常堆栈';
|
|
|
+COMMENT ON COLUMN log_error.create_time IS '创建时间';
|
|
|
|
|
|
|
|
|
-DROP TABLE chat_history;
|
|
|
+DROP TABLE IF EXISTS chat_history;
|
|
|
CREATE TABLE chat_history (
|
|
|
id bigserial PRIMARY KEY, -- 主键
|
|
|
user_id text NULL, -- 用户id
|
|
@@ -31,13 +25,61 @@ CREATE TABLE chat_history (
|
|
|
"chat_A" text NULL, -- chat回答
|
|
|
create_time timestamp(0) DEFAULT now() NULL, -- 创建时间
|
|
|
update_time timestamp(0) DEFAULT now() NULL, -- 更改时间
|
|
|
- is_deleted int4 DEFAULT 0 NULL -- 是否删除
|
|
|
+ is_deleted int2 DEFAULT 0 NULL -- 是否删除
|
|
|
+);
|
|
|
+
|
|
|
+COMMENT ON COLUMN chat_history.id IS '主键';
|
|
|
+COMMENT ON COLUMN chat_history.user_id IS '用户id';
|
|
|
+COMMENT ON COLUMN chat_history."user_Q" IS '用户提问';
|
|
|
+COMMENT ON COLUMN chat_history."chat_A" IS 'chat回答';
|
|
|
+COMMENT ON COLUMN chat_history.create_time IS '创建时间';
|
|
|
+COMMENT ON COLUMN chat_history.update_time IS '更改时间';
|
|
|
+COMMENT ON COLUMN chat_history.is_deleted IS '是否删除';
|
|
|
+
|
|
|
+
|
|
|
+DROP TABLE IF EXISTS user_list;
|
|
|
+CREATE TABLE user_list (
|
|
|
+ id bigserial primary key, -- 主键
|
|
|
+ user_id text not null, -- 用户id
|
|
|
+ user_name text unique, -- 用户名
|
|
|
+ user_password text NULL, -- 密码
|
|
|
+ create_time timestamp(0) DEFAULT now() NULL, -- 创建时间
|
|
|
+ update_time timestamp(0) DEFAULT now() NULL, -- 更新时间
|
|
|
+ is_deleted int2 default 0 NULL -- 是否删除
|
|
|
);
|
|
|
+COMMENT ON TABLE user_list IS '用户列表';
|
|
|
+
|
|
|
+-- Column comments
|
|
|
+
|
|
|
+COMMENT ON COLUMN user_list.id IS '主键';
|
|
|
+COMMENT ON COLUMN user_list.user_id IS '用户id';
|
|
|
+COMMENT ON COLUMN user_list.user_name IS '用户名';
|
|
|
+COMMENT ON COLUMN user_list.user_password IS '密码';
|
|
|
+COMMENT ON COLUMN user_list.create_time IS '创建时间';
|
|
|
+COMMENT ON COLUMN user_list.update_time IS '更新时间';
|
|
|
+COMMENT ON COLUMN user_list.is_deleted IS '是否删除';
|
|
|
+
|
|
|
+
|
|
|
+-- public.search_api definition
|
|
|
+
|
|
|
+-- Drop table
|
|
|
+
|
|
|
+DROP TABLE IF EXISTS search_api;
|
|
|
+CREATE TABLE search_api (
|
|
|
+ id bigserial primary key, -- 自增主键
|
|
|
+ s_method text DEFAULT 'GET'::text NULL, -- 请求方法
|
|
|
+ s_url text NULL, -- 请求地址
|
|
|
+ s_param text NULL, -- 请求参数
|
|
|
+ s_description text NULL, -- 接口说明
|
|
|
+ s_tsdescription tsvector NULL -- 接口说明的全文检索
|
|
|
+);
|
|
|
+CREATE INDEX ON public.search_api USING gin (s_tsdescription);
|
|
|
+
|
|
|
+-- Column comments
|
|
|
|
|
|
-COMMENT ON COLUMN public.chat_history.id IS '主键';
|
|
|
-COMMENT ON COLUMN public.chat_history.user_id IS '用户id';
|
|
|
-COMMENT ON COLUMN public.chat_history."user_Q" IS '用户提问';
|
|
|
-COMMENT ON COLUMN public.chat_history."chat_A" IS 'chat回答';
|
|
|
-COMMENT ON COLUMN public.chat_history.create_time IS '创建时间';
|
|
|
-COMMENT ON COLUMN public.chat_history.update_time IS '更改时间';
|
|
|
-COMMENT ON COLUMN public.chat_history.is_deleted IS '是否删除';
|
|
|
+COMMENT ON COLUMN public.search_api.id IS '自增主键';
|
|
|
+COMMENT ON COLUMN public.search_api.s_method IS '请求方法';
|
|
|
+COMMENT ON COLUMN public.search_api.s_url IS '请求地址';
|
|
|
+COMMENT ON COLUMN public.search_api.s_param IS '请求参数';
|
|
|
+COMMENT ON COLUMN public.search_api.s_description IS '接口说明';
|
|
|
+COMMENT ON COLUMN public.search_api.s_tsdescription IS '接口说明的全文检索';
|