forked from JemCasey/playtesting-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-schema.ts
93 lines (85 loc) · 1.69 KB
/
init-schema.ts
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
const Database = require('better-sqlite3');
const db = new Database('database.db');
db.exec(`
CREATE TABLE IF NOT EXISTS server_channel (
id INTEGER PRIMARY KEY AUTOINCREMENT,
server_id TEXT,
channel_id TEXT,
result_channel_id TEXT,
channel_type INT
)
`);
db.exec(`
CREATE TABLE IF NOT EXISTS server_setting (
server_id TEXT PRIMARY KEY,
packet_name TEXT
)
`);
db.exec(`
CREATE TABLE IF NOT EXISTS tossup (
question_id TEXT PRIMARY KEY,
server_id TEXT,
author_id TEXT,
total_characters INT,
category TEXT,
answer TEXT,
thread_id TEXT
)
`)
db.exec(`
CREATE TABLE IF NOT EXISTS bonus (
question_id TEXT PRIMARY KEY,
server_id TEXT,
author_id TEXT,
category TEXT,
thread_id TEXT
)
`)
db.exec(`
CREATE TABLE IF NOT EXISTS bonus_part (
id INTEGER PRIMARY KEY AUTOINCREMENT,
question_id TEXT,
part INT,
difficulty TEXT,
answer TEXT,
UNIQUE (question_id, part)
)
`)
db.exec(`
CREATE TABLE IF NOT EXISTS buzz (
id INTEGER PRIMARY KEY AUTOINCREMENT,
server_id TEXT,
question_id TEXT,
author_id TEXT,
user_id TEXT,
clue_index INT,
characters_revealed INT,
value INT,
answer_given TEXT
)
`)
db.exec(`
CREATE TABLE IF NOT EXISTS bonus_direct (
id INTEGER PRIMARY KEY AUTOINCREMENT,
server_id TEXT,
question_id TEXT,
author_id TEXT,
user_id TEXT,
part INT,
value INT,
answer_given TEXT
)
`)
db.exec(`
CREATE TABLE IF NOT EXISTS bulk (
question_id TEXT PRIMARY KEY,
server_id TEXT,
channel_id TEXT,
packet_name TEXT,
question_number INT,
question_type TEXT,
category TEXT,
answers TEXT,
echo_id TEXT
)
`)