-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.sql
35 lines (30 loc) · 856 Bytes
/
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
CREATE TABLE IF NOT EXISTS accounts (
discord_id INTEGER NOT NULL,
ic_id INTEGER NOT NULL,
linked_at INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS guilds (
guild_id INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS colors (
user_id INTEGER NOT NULL,
submission_id INTEGER PRIMARY KEY AUTOINCREMENT,
color INTEGER NOT NULL,
upvotes INTEGER NOT NULL DEFAULT 1,
downvotes INTEGER NOT NULL DEFAULT 0,
created INTEGER NOT NULL,
name TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS tags (
tag_id INTEGER PRIMARY KEY AUTOINCREMENT,
tag_name TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS color_tags (
submission_id INTEGER NOT NULL,
tag_id INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS color_votes (
user_id INTEGER NOT NULL,
submission_id INTEGER NOT NULL,
vote INTEGER NOT NULL
);