-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathdatabase.pgsql
More file actions
61 lines (51 loc) · 1.74 KB
/
Copy pathdatabase.pgsql
File metadata and controls
61 lines (51 loc) · 1.74 KB
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
55
56
57
58
59
60
61
CREATE TABLE IF NOT EXISTS guild_settings(
guild_id BIGINT NOT NULL,
guild_specific_families BOOLEAN DEFAULT FALSE,
allow_incest BOOLEAN DEFAULT FALSE,
gifs_enabled BOOLEAN DEFAULT TRUE,
PRIMARY KEY (guild_id)
);
-- A config for a guild to change their prefix or other bot settings.
CREATE TABLE IF NOT EXISTS marriages(
user_id BIGINT NOT NULL,
partner_id BIGINT NOT NULL,
guild_id BIGINT NOT NULL DEFAULT 0,
timestamp TIMESTAMP,
PRIMARY KEY (user_id, partner_id, guild_id)
);
-- A table to hold a user and their partner. The primary key
-- stops users from getting married twice. This may need revisiting
-- in the near future.
CREATE TABLE IF NOT EXISTS parents(
child_id BIGINT NOT NULL,
parent_id BIGINT NOT NULL,
guild_id BIGINT NOT NULL DEFAULT 0,
timestamp TIMESTAMP,
PRIMARY KEY (child_id, guild_id)
);
-- A table holding a child and their parent. Since a child can only have
-- one parent (a decision made long ago), the child has been made the
-- primary key of the table.
CREATE TABLE IF NOT EXISTS guild_specific_families(
guild_id BIGINT NOT NULL,
purchased_by BIGINT,
PRIMARY KEY (guild_id)
);
-- A list of guild IDs of people who've paid for Gold.
CREATE TABLE IF NOT EXISTS customisation(
user_id BIGINT NOT NULL,
edge INTEGER DEFAULT NULL,
node INTEGER DEFAULT NULL,
font INTEGER DEFAULT NULL,
highlighted_font INTEGER DEFAULT NULL,
highlighted_node INTEGER DEFAULT NULL,
background INTEGER DEFAULT NULL,
direction CHAR(2) DEFAULT 'TB',
PRIMARY KEY (user_id)
);
-- A table for user tree customisations. The nulls are all set in the
-- bot's code for defaults.
CREATE TABLE IF NOT EXISTS usernames(
id BIGINT PRIMARY KEY,
name TEXT
);