Commit 6f578bb3 by 文靖昊

使用一个database

parent e78c7fe2
......@@ -12,20 +12,4 @@ services:
- ./lae_pg_data:/var/lib/postgresql/data
- ./init_db/create_db.sql:/docker-entrypoint-initdb.d/create_db.sql
- ./init_db/create_table.sql:/docker-entrypoint-initdb.d/create_table.sql
- ./init_db/insert_data.sql:/docker-entrypoint-initdb.d/insert_data.sql
python:
build:
context: .
dockerfile: Dockerfile
image: lae_python_image:v1
container_name: lae_python
ports:
- "8003:8003"
stdin_open: true
tty: true
command: sh -c "cd src && python gradio_app.py"
volumes:
lae_pg_data:
create database lae;
create database lae_chat;
\ No newline at end of file
......@@ -72,10 +72,24 @@ START 1
CACHE 1;
ALTER TABLE c_user ALTER COLUMN user_id SET DEFAULT nextval('c_user_seq'::regclass);
INSERT INTO public.c_user (user_id, account, password) VALUES ('1', 'zhangs', '111111');
INSERT INTO public.c_user (user_id, account, password) VALUES ('2', 'lis', '111111');
create table txt_doc
(
hash varchar(40) not null
primary key,
text text not null,
matadate text
);
alter table txt_doc
owner to postgres;
create table vec_txt
(
vector_id varchar(36) not null
primary key,
text text,
paragraph_id varchar(40) not null
);
INSERT INTO public.chat (chat_id, user_id, info, create_time, deleted) VALUES ('1', '1', '这是chat_id为1的问答info', '2024-05-27 01:12:05.022546', 0);
INSERT INTO public.chat (chat_id, user_id, info, create_time, deleted) VALUES ('2', '1', '这是chat_id为2的问答info', '2024-05-27 01:12:05.025912', 0);
INSERT INTO public.chat (chat_id, user_id, info, create_time, deleted) VALUES ('3', '2', '这是chat_id为3的问答info', '2024-05-27 01:12:05.027267', 0);
INSERT INTO public.chat (chat_id, user_id, info, create_time, deleted) VALUES ('4', '2', '这是chat_id为4的问答info', '2024-05-27 01:12:05.028840', 0);
alter table vec_txt
owner to postgres;
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,7 +11,7 @@ VEC_DB_PORT = '5433'
# 聊天相关数据库配置
# =============================
CHAT_DB_HOST = '192.168.10.93'
CHAT_DB_DBNAME = 'lae_chat'
CHAT_DB_DBNAME = 'lae'
CHAT_DB_USER = 'postgres'
CHAT_DB_PASSWORD = '111111'
CHAT_DB_PORT = '5433'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment