-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSCHEMA.sql
More file actions
29 lines (26 loc) · 823 Bytes
/
SCHEMA.sql
File metadata and controls
29 lines (26 loc) · 823 Bytes
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
-- Active: 1703653682760@@127.0.0.1@5432@timebot_test
CREATE TABLE IF NOT EXISTS users (
uid BIGINT PRIMARY KEY,
discord_id BIGINT UNIQUE,
twitch_id BIGINT UNIQUE,
moderator BOOLEAN NOT NULL DEFAULT false,
token TEXT UNIQUE NOT NULL,
created TIMESTAMP DEFAULT (now() at time zone 'utc')
);
CREATE TABLE IF NOT EXISTS state (
code TEXT PRIMARY KEY,
discord_id BIGINT UNIQUE NOT NULL,
moderator BOOLEAN DEFAULT false
);
CREATE TABLE IF NOT EXISTS quotes (
id SERIAL PRIMARY KEY,
content TEXT UNIQUE NOT NULL,
added_by BIGINT NOT NULL,
speaker BIGINT,
source TEXT NOT NULL,
created TIMESTAMP DEFAULT (now() at time zone 'utc')
);
CREATE TABLE IF NOT EXISTS first_redeem (
twitch_id BIGINT NOT NULL,
timestamp TIMESTAMP DEFAULT (now() at time zone 'utc')
)