-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.sql
54 lines (47 loc) · 1.2 KB
/
schema.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
PRAGMA user_version = 4;
CREATE TABLE users
(
id TEXT PRIMARY KEY,
admin BOOLEAN DEFAULT FALSE,
golink_approved BOOLEAN DEFAULT FALSE,
manage_own_infoboxes BOOLEAN DEFAULT FALSE
);
CREATE TABLE categories
(
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL,
displayorder NUMBER NOT NULL
);
CREATE TABLE announcements
(
id INTEGER PRIMARY KEY,
text TEXT,
enabled BOOLEAN DEFAULT TRUE
);
CREATE TABLE infoboxes
(
id INTEGER PRIMARY KEY,
type TEXT NOT NULL,
name TEXT NOT NULL,
description TEXT NOT NULL,
displayorder NUMBER NOT NULL,
categoryid NUMBER NOT NULL,
owner TEXT NOT NULL,
FOREIGN KEY (categoryid) REFERENCES categories (id),
FOREIGN KEY (owner) REFERENCES users (id)
);
CREATE TABLE links
(
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
destination TEXT NOT NULL,
infoboxid NUMBER NOT NULL
);
CREATE TABLE golinks
(
name TEXT PRIMARY KEY,
destination TEXT NOT NULL,
owner TEXT NOT NULL,
FOREIGN KEY (owner) REFERENCES users (id)
);