DROP TABLE IF EXISTS log_error; CREATE TABLE log_error ( id bigserial PRIMARY KEY, -- 主键 "exception" text NULL, -- 异常 message text NULL, -- 异常消息 error_info text NULL, -- 异常详细消息 error_stack_trace text NULL, -- 异常堆栈 create_time timestamp(0) DEFAULT now() NULL -- 创建时间 ); 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 IF EXISTS chat_history; CREATE TABLE chat_history ( id bigserial PRIMARY KEY, -- 主键 user_id text NULL, -- 用户id "user_Q" text NULL, -- 用户提问 "chat_A" text NULL, -- chat回答 create_time timestamp(0) DEFAULT now() NULL, -- 创建时间 update_time timestamp(0) DEFAULT now() 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, -- 用户名 user_password text NULL, -- 密码 create_time timestamp(0) DEFAULT now() NULL, -- 创建时间 update_time timestamp(0) DEFAULT now() NULL, -- 更新时间 is_deleted int2 default 0, -- 是否删除 UNIQUE (user_name, is_deleted) ); 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 '是否删除';