-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_db.sql
65 lines (60 loc) · 1.96 KB
/
create_db.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
CREATE TABLE key_value (
"key" varchar(100) NOT NULL PRIMARY KEY,
value varchar(250) NOT NULL
);
CREATE TABLE reminder (
id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
created_at timetz NOT NULL,
fire_at timetz NOT NULL,
user_id int8 NOT NULL,
channel_id int8 NOT NULL,
guild_id int8 NOT NULL,
is_dm bool NOT NULL,
message varchar(500) NOT NULL
);
CREATE TABLE twitch_live_stream (
twitch_user_id varchar(50) NOT NULL PRIMARY KEY,
twitch_stream_id varchar(50) NOT NULL,
started_at timetz NOT NULL,
first_offline_at timetz NULL,
twitch_login varchar(50) NOT NULL,
twitch_display_name varchar(50) NOT NULL,
viewer_count int4 NOT NULL,
title varchar(200) NOT NULL,
game_name varchar(300) NOT NULL,
game_id varchar(50) NOT NULL,
thumbnail_url varchar(350) NOT NULL,
profile_image_url varchar(350) NOT NULL
);
CREATE TABLE twitch_stream_to_check (
id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
twitch_id varchar(50) NOT NULL,
username varchar(50) NOT NULL,
message_to_post varchar(1500) NOT NULL,
channel_id int8 NOT NULL,
guild_id int8 NOT NULL,
is_embedded bool NOT NULL,
is_deleted bool NOT NULL,
current_message_id int8 NULL
);
CREATE TABLE twitter_to_check (
id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
twitter_username varchar(100) NOT NULL,
twitter_id int8 NOT NULL,
include_retweets bool NOT NULL,
discord_guild_id int8 NOT NULL,
discord_channel_id int8 NOT NULL
);
CREATE TABLE youtube_channel_to_check (
id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
username varchar(50) NOT NULL,
discord_guild_id int8 NOT NULL,
discord_channel_id int8 NOT NULL,
discord_message_to_post varchar(200) NOT NULL,
youtube_channel_id varchar(40) NOT NULL,
youtube_playlist_id varchar(40) NOT NULL,
is_deleted bool NOT NULL,
latest_video_id varchar(40) NULL,
latest_video_uploaded_at timestamptz NULL,
discord_message_id int8 NULL
);