forked from python-discord/site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sql
146 lines (123 loc) · 1.74 KB
/
init.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
CREATE DATABASE metricity;
\c metricity;
CREATE TABLE users (
id varchar,
joined_at timestamp,
primary key(id)
);
INSERT INTO users VALUES (
0,
current_timestamp
);
INSERT INTO users VALUES (
1,
current_timestamp
);
CREATE TABLE channels (
id varchar,
name varchar,
primary key(id)
);
INSERT INTO channels VALUES(
'267659945086812160',
'python-general'
);
INSERT INTO channels VALUES(
'11',
'help-apple'
);
INSERT INTO channels VALUES(
'12',
'help-cherry'
);
INSERT INTO channels VALUES(
'21',
'ot0-hello'
);
INSERT INTO channels VALUES(
'22',
'ot1-world'
);
INSERT INTO channels VALUES(
'31',
'voice-chat-0'
);
INSERT INTO channels VALUES(
'32',
'code-help-voice-0'
);
INSERT INTO channels VALUES(
'1234',
'zebra'
);
CREATE TABLE messages (
id varchar,
author_id varchar references users(id),
is_deleted boolean,
created_at timestamp,
channel_id varchar references channels(id),
primary key(id)
);
INSERT INTO messages VALUES(
0,
0,
false,
now(),
'267659945086812160'
);
INSERT INTO messages VALUES(
1,
0,
false,
now() + INTERVAL '10 minutes,',
'1234'
);
INSERT INTO messages VALUES(
2,
0,
false,
now(),
'11'
);
INSERT INTO messages VALUES(
3,
0,
false,
now(),
'12'
);
INSERT INTO messages VALUES(
4,
1,
false,
now(),
'21'
);
INSERT INTO messages VALUES(
5,
1,
false,
now(),
'22'
);
INSERT INTO messages VALUES(
6,
1,
false,
now(),
'31'
);
INSERT INTO messages VALUES(
7,
1,
false,
now(),
'32'
);
INSERT INTO messages VALUES(
8,
1,
true,
now(),
'32'
);