-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetupDB.sql
55 lines (34 loc) · 1009 Bytes
/
setupDB.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
ALTER ROLE postgres PASSWORD 'postgres';
CREATE ROLE vectordb WITH LOGIN PASSWORD 'vectordb';
CREATE database vectordb WITH OWNER vectordb;
\c vectordb
CREATE EXTENSION vector;
\c vectordb
CREATE TABLE articles (
id integer NOT NULL,
url text,
title text,
content text
);
ALTER TABLE articles OWNER TO vectordb;
CREATE TABLE articles_minilm (
id integer NOT NULL,
title_vector vector(384),
content_vector vector(384)
);
ALTER TABLE articles_minilm OWNER TO vectordb;
CREATE TABLE articles_openai (
id integer NOT NULL,
title_vector vector(1536),
content_vector vector(1536),
vector_id integer
);
ALTER TABLE articles_openai OWNER TO vectordb;
ALTER TABLE ONLY articles_minilm
ADD CONSTRAINT articles_minilm_pkey PRIMARY KEY (id);
ALTER TABLE ONLY articles
ADD CONSTRAINT articles_openai_pkey PRIMARY KEY (id);
ALTER TABLE ONLY articles_openai
ADD CONSTRAINT articles_openai_pkey1 PRIMARY KEY (id);
\c vectordb
\i /vectordb_data.sql