This repository has been archived by the owner on Sep 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathyumebot.sql
521 lines (360 loc) · 11.3 KB
/
yumebot.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.3 (Debian 12.3-1.pgdg100+1)
-- Dumped by pg_dump version 12rc1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'standard public schema';
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: admin; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.admin (
role_id text NOT NULL,
guild_id text NOT NULL,
admin boolean NOT NULL
);
ALTER TABLE public.admin OWNER TO postgres;
--
-- Name: anon; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.anon (
guild_id text NOT NULL,
channel_id text NOT NULL
);
ALTER TABLE public.anon OWNER TO postgres;
--
-- Name: anon_logs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.anon_logs (
message_id text NOT NULL,
guild_id text NOT NULL,
user_id text NOT NULL
);
ALTER TABLE public.anon_logs OWNER TO postgres;
--
-- Name: anon_users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.anon_users (
user_id text NOT NULL,
blocked boolean DEFAULT false NOT NULL,
guild_id text NOT NULL
);
ALTER TABLE public.anon_users OWNER TO postgres;
--
-- Name: chan_network; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.chan_network (
chan_id text NOT NULL,
guild_id text NOT NULL
);
ALTER TABLE public.chan_network OWNER TO postgres;
--
-- Name: d_date; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.d_date (
date_dim_id integer NOT NULL,
date_actual date NOT NULL,
epoch bigint NOT NULL,
day_suffix character varying(4) NOT NULL,
day_name character varying(9) NOT NULL,
day_of_week integer NOT NULL,
day_of_month integer NOT NULL,
day_of_quarter integer NOT NULL,
day_of_year integer NOT NULL,
week_of_month integer NOT NULL,
week_of_year integer NOT NULL,
week_of_year_iso character(10) NOT NULL,
month_actual integer NOT NULL,
month_name character varying(9) NOT NULL,
month_name_abbreviated character(3) NOT NULL,
quarter_actual integer NOT NULL,
quarter_name character varying(9) NOT NULL,
year_actual integer NOT NULL,
first_day_of_week date NOT NULL,
last_day_of_week date NOT NULL,
first_day_of_month date NOT NULL,
last_day_of_month date NOT NULL,
first_day_of_quarter date NOT NULL,
last_day_of_quarter date NOT NULL,
first_day_of_year date NOT NULL,
last_day_of_year date NOT NULL,
mmyyyy character(6) NOT NULL,
mmddyyyy character(10) NOT NULL,
weekend_indr boolean NOT NULL
);
ALTER TABLE public.d_date OWNER TO postgres;
--
-- Name: daily_messages; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.daily_messages (
id integer NOT NULL,
guild_id text NOT NULL,
date_id integer NOT NULL,
counter integer NOT NULL
);
ALTER TABLE public.daily_messages OWNER TO postgres;
--
-- Name: daily_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.daily_messages_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.daily_messages_id_seq OWNER TO postgres;
--
-- Name: daily_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.daily_messages_id_seq OWNED BY public.daily_messages.id;
--
-- Name: guild; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.guild (
guild_id text NOT NULL,
blacklist boolean NOT NULL,
color boolean NOT NULL,
greet boolean NOT NULL,
greet_chan text,
log_chan text,
logging boolean NOT NULL,
setup boolean NOT NULL,
vip boolean NOT NULL
);
ALTER TABLE public.guild OWNER TO postgres;
--
-- Name: messages; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.messages (
message_id text NOT NULL,
guild_id text NOT NULL,
channel_id text NOT NULL,
user_id text NOT NULL,
time_id integer NOT NULL
);
ALTER TABLE public.messages OWNER TO postgres;
--
-- Name: muted; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.muted (
user_id text NOT NULL,
guild_id text NOT NULL
);
ALTER TABLE public.muted OWNER TO postgres;
--
-- Name: private; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.private (
guild_id text NOT NULL,
cat_id text NOT NULL,
role_id text NOT NULL,
name_prefix text DEFAULT 'private'::text NOT NULL,
hub_id text NOT NULL
);
ALTER TABLE public.private OWNER TO postgres;
--
-- Name: private_users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.private_users (
user_id text NOT NULL,
cat_id text NOT NULL,
chan_id text NOT NULL
);
ALTER TABLE public.private_users OWNER TO postgres;
--
-- Name: rankings; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.rankings (
user_id text NOT NULL,
guild_id text NOT NULL,
level bigint NOT NULL,
xp bigint NOT NULL,
total bigint NOT NULL,
reach bigint NOT NULL
);
ALTER TABLE public.rankings OWNER TO postgres;
--
-- Name: rankings_chan; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.rankings_chan (
guild_id text NOT NULL,
chan_id text NOT NULL
);
ALTER TABLE public.rankings_chan OWNER TO postgres;
--
-- Name: roles; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.roles (
guild_id text NOT NULL,
role_id text NOT NULL,
level integer NOT NULL
);
ALTER TABLE public.roles OWNER TO postgres;
--
-- Name: sanctions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.sanctions (
sanction_id text NOT NULL,
event text NOT NULL,
guild_id text NOT NULL,
moderator_id text NOT NULL,
reason text,
"time" bigint,
user_id bigint NOT NULL,
event_date date NOT NULL
);
ALTER TABLE public.sanctions OWNER TO postgres;
--
-- Name: user; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."user" (
user_id text NOT NULL,
vip boolean NOT NULL,
crew boolean NOT NULL,
description text NOT NULL,
married boolean DEFAULT false NOT NULL,
lover text
);
ALTER TABLE public."user" OWNER TO postgres;
--
-- Name: user_network; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.user_network (
user_id text NOT NULL
);
ALTER TABLE public.user_network OWNER TO postgres;
--
-- Name: daily_messages id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.daily_messages ALTER COLUMN id SET DEFAULT nextval('public.daily_messages_id_seq'::regclass);
--
-- Name: admin admin_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.admin
ADD CONSTRAINT admin_pkey PRIMARY KEY (role_id, guild_id);
--
-- Name: anon_users anon_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.anon_users
ADD CONSTRAINT anon_users_pkey PRIMARY KEY (user_id, guild_id);
--
-- Name: d_date d_date_date_dim_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.d_date
ADD CONSTRAINT d_date_date_dim_id_pk PRIMARY KEY (date_dim_id);
--
-- Name: muted muted_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.muted
ADD CONSTRAINT muted_pkey PRIMARY KEY (user_id, guild_id);
--
-- Name: private_users private_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.private_users
ADD CONSTRAINT private_users_pkey PRIMARY KEY (user_id, cat_id);
--
-- Name: rankings rankings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.rankings
ADD CONSTRAINT rankings_pkey PRIMARY KEY (user_id, guild_id);
--
-- Name: roles roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.roles
ADD CONSTRAINT roles_pkey PRIMARY KEY (guild_id, level);
--
-- Name: anon unique_anon_guild_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.anon
ADD CONSTRAINT unique_anon_guild_id UNIQUE (guild_id);
--
-- Name: anon_logs unique_anon_logs_message_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.anon_logs
ADD CONSTRAINT unique_anon_logs_message_id UNIQUE (message_id);
--
-- Name: chan_network unique_chan_network_chan_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.chan_network
ADD CONSTRAINT unique_chan_network_chan_id UNIQUE (chan_id);
--
-- Name: guild unique_guild_guild_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.guild
ADD CONSTRAINT unique_guild_guild_id PRIMARY KEY (guild_id);
--
-- Name: messages unique_messages_message_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.messages
ADD CONSTRAINT unique_messages_message_id UNIQUE (message_id);
--
-- Name: private unique_private_cat_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.private
ADD CONSTRAINT unique_private_cat_id PRIMARY KEY (cat_id);
--
-- Name: private unique_private_hub_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.private
ADD CONSTRAINT unique_private_hub_id UNIQUE (hub_id);
--
-- Name: private_users unique_private_users_chan_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.private_users
ADD CONSTRAINT unique_private_users_chan_id UNIQUE (chan_id);
--
-- Name: rankings_chan unique_rankings_chan_chan_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.rankings_chan
ADD CONSTRAINT unique_rankings_chan_chan_id UNIQUE (chan_id);
--
-- Name: sanctions unique_sanctions_sanction_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.sanctions
ADD CONSTRAINT unique_sanctions_sanction_id PRIMARY KEY (sanction_id);
--
-- Name: user unique_user_lover; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."user"
ADD CONSTRAINT unique_user_lover UNIQUE (lover);
--
-- Name: user_network unique_user_network_user_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_network
ADD CONSTRAINT unique_user_network_user_id UNIQUE (user_id);
--
-- Name: user unique_user_user_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."user"
ADD CONSTRAINT unique_user_user_id PRIMARY KEY (user_id);
--
-- Name: d_date_date_actual_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX d_date_date_actual_idx ON public.d_date USING btree (date_actual);
--
-- Name: index_guild_id; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX index_guild_id ON public.private USING btree (guild_id);
--
-- PostgreSQL database dump complete
--