aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/postgres.sql
blob: 1d73dfcba2f294d46ecb25e20f0ce1190fb192e8 (plain) (blame)
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
CREATE TABLE IF NOT EXISTS config (
    id bigserial primary key,
    name varchar(255) NOT NULL,
    value varchar(255) NOT NULL
);

CREATE TABLE IF NOT EXISTS entries (
    id bigserial primary key,
    title varchar(255) NOT NULL,
    url varchar(255) NOT NULL,
    is_read boolean DEFAULT false,
    is_fav boolean DEFAULT false,
    content TEXT,
    user_id integer NOT NULL
);

CREATE TABLE IF NOT EXISTS users (
    id bigserial primary key,
    username varchar(255) NOT NULL,
    password varchar(255) NOT NULL,
    name varchar(255) NOT NULL,
    email varchar(255) NOT NULL
);

CREATE TABLE IF NOT EXISTS users_config (
    id bigserial primary key,
    user_id integer NOT NULL,
    name varchar(255) NOT NULL,
    value varchar(255) NOT NULL
);

CREATE TABLE IF NOT EXISTS tags (
  id bigserial primary key,
  value varchar(255) NOT NULL
);

CREATE TABLE IF NOT EXISTS tags_entries (
  id bigserial primary key,
  entry_id integer NOT NULL,
  tag_id integer NOT NULL
)