-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtables.sql
149 lines (127 loc) · 3.55 KB
/
tables.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
CREATE TABLE IF NOT EXISTS blacklist(
snowflake_id BIGINT PRIMARY KEY,
REASON VARCHAR(4000),
timestamp TIMESTAMP);
CREATE TABLE IF NOT EXISTS commands_list(
guild_id BIGINT NOT NULL,
bot_id BIGINT NOT NULL,
command VARCHAR(100) NOT NULL,
time_used TIMESTAMP);
CREATE TABLE IF NOT EXISTS prefixes_list(
guild_id BIGINT NOT NULL,
bot_id BIGINT NOT NULL,
prefix VARCHAR(100),
usage INTEGER NOT NULL,
last_usage TIMESTAMP NOT NULL,
UNIQUE(guild_id, bot_id, prefix));
CREATE TABLE IF NOT EXISTS bot_repo(
bot_id BIGINT NOT NULL,
owner_repo VARCHAR(2000),
bot_name VARCHAR(2000),
certainty NUMERIC(20, 2),
PRIMARY KEY(bot_id));
CREATE TABLE IF NOT EXISTS confirmed_bots(
bot_id BIGINT,
author_id BIGINT,
reason VARCHAR(2000),
requested_at TIMESTAMP,
jump_url VARCHAR(1000),
joined_at TIMESTAMP,
UNIQUE(bot_id)
);
CREATE TABLE IF NOT EXISTS pending_bots(
bot_id BIGINT PRIMARY KEY,
author_id BIGINT,
reason VARCHAR(2050),
requested_at TIMESTAMP,
jump_url VARCHAR(1000)
);
CREATE TABLE IF NOT EXISTS reports(
report_id SERIAL,
user_id BIGINT NOT NULL,
finish BOOLEAN NOT NULL,
reported_at TIMESTAMP,
PRIMARY KEY (report_id)
);
CREATE TABLE IF NOT EXISTS resport_respond(
report_id BIGINT NOT NULL,
user_id BIGINT NOT NULL,
interface_id BIGINT,
message_id BIGINT NOT NULL,
message VARCHAR(4000),
FOREIGN KEY (report_id) REFERENCES reports(report_id)
);
CREATE TABLE IF NOT EXISTS position_letter(
bot_id BIGINT,
letter CHAR,
position INT,
count INT,
PRIMARY KEY(bot_id, letter, "position")
);
CREATE TABLE IF NOT EXISTS internal_prefix(
snowflake_id BIGINT UNIQUE,
prefix VARCHAR(30)
);
CREATE TABLE IF NOT EXISTS bot_tasks(
task_id SERIAL PRIMARY KEY,
last_execution TIMESTAMP WITH TIME ZONE,
next_execution TIMESTAMP WITH TIME ZONE
);
CREATE TABLE IF NOT EXISTS wordle_tag(
tag VARCHAR(100) PRIMARY KEY,
user_id BIGINT NOT NULL,
used INT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
description VARCHAR(2000)
);
CREATE TABLE IF NOT EXISTS wordle_word(
tag VARCHAR(100) NOT NULL,
word VARCHAR(20) NOT NULL,
FOREIGN KEY (tag) REFERENCES wordle_tag(tag),
UNIQUE(tag, word)
);
CREATE TABLE IF NOT EXISTS wordle_rank(
user_id BIGINT NOT NULL,
tag VARCHAR(100) NOT NULL,
word VARCHAR(20) NOT NULL,
attempt INT NOT NULL,
amount INT NOT NULL,
FOREIGN KEY (tag) REFERENCES wordle_tag(tag),
UNIQUE (user_id, tag, word, attempt)
);
CREATE TABLE IF NOT EXISTS button_game(
user_id BIGINT PRIMARY KEY,
amount BIGINT DEFAULT 1
)
CREATE TABLE IF NOT EXISTS wombo_style(
style_id INT PRIMARY KEY,
style_count INT DEFAULT 1,
style_emoji BIGINT
)
CREATE TABLE IF NOT EXISTS wombo_saved(
name VARCHAR(100) PRIMARY KEY,
user_id BIGINT NOT NULL,
image_url VARCHAR(3000) NOT NULL,
vote INT DEFAULT 0,
is_nsfw BOOLEAN NOT NULL,
prompt VARCHAR(100) NOT NULL,
style VARCHAR(100) NOT NULL,
)
CREATE TABLE IF NOT EXISTS wombo_liker(
name VARCHAR(100),
user_id BIGINT,
PRIMARY KEY(name, user_id)
)
CREATE TABLE IF NOT EXISTS wombo_data_seen(
name VARCHAR(1000),
seen BOOLEAN DEFAULT FALSE
)
CREATE TABLE IF NOT EXISTS click_game_logger(
user_id BIGINT NOT NULL,
click_time TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
)
CREATE TABLE IF NOT EXISTS either_io(
user_id BIGINT NOT NULL,
question_id BIGINT NOT NULL,
answered INT NOT NULL
)