-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.sql
97 lines (77 loc) · 2.38 KB
/
database.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
CREATE DATABASE IF NOT EXISTS stickerBotDataBase;
USE stickerBotDataBase;
CREATE TABLE IF NOT EXISTS userState (
user_id BIGINT NOT NULL,
chat_id BIGINT NOT NULL,
state_id SMALLINT NOT NULL,
PRIMARY KEY (user_id, chat_id)
);
CREATE TABLE IF NOT EXISTS stickerPackOwner(
sticker_pack_id VARCHAR(512) NOT NULL UNIQUE,
owner_id BIGINT NOT NULL,
PRIMARY KEY (sticker_pack_id)
);
CREATE TABLE IF NOT EXISTS groupStickerPack(
chat_id BIGINT NOT NULL UNIQUE ,
# pack_owner_id BIGINT NOT NULL ,
sticker_pack_name VARCHAR(1000) NOT NULL,
PRIMARY KEY (chat_id)
);
CREATE TABLE IF NOT EXISTS userCurrentStickerPack (
user_id BIGINT NOT NULL,
chat_id BIGINT NOT NULL,
sticker_pack_id VARCHAR(1000) NOT NULL,
PRIMARY KEY (user_id, chat_id)
);
CREATE TABLE IF NOT EXISTS userStickerPacks (
user_id BIGINT NOT NULL,
chat_id BIGINT NOT NULL,
sticker_pack_id VARCHAR(1000) NOT NULL,
PRIMARY KEY (user_id, chat_id)
);
CREATE TABLE IF NOT EXISTS defaultUserEmojy (
user_id BIGINT NOT NULL UNIQUE,
emojy VARCHAR(1) CHARACTER SET utf8mb4 NOT NULL,
PRIMARY KEY (user_id)
);
CREATE TABLE IF NOT EXISTS chatWelcomeMessage (
chat_id BIGINT NOT NULL UNIQUE ,
welcome_message VARCHAR(1000) NOT NULL,
PRIMARY KEY (chat_id)
);
CREATE TABLE IF NOT EXISTS chatUserCaption (
chat_id BIGINT NOT NULL,
user_id BIGINT NOT NULL,
welcome_message VARCHAR(1000) NOT NULL,
CONSTRAINT uniqChatUser UNIQUE (chat_id, user_id)
);
CREATE TABLE IF NOT EXISTS hogwartsGameRole (
user_id BIGINT NOT NULL,
chat_id BIGINT NOT NULL,
team_id INT NOT NULL,
snitch_score INT NOT NULL,
prihod_score INT NOT NULL,
last_stitch_time BIGINT NOT NULL,
last_prihod_time BIGINT NOT NULL,
PRIMARY KEY (user_id, chat_id)
);
CREATE TABLE IF NOT EXISTS hogwartsStats (
chat_id BIGINT NOT NULL UNIQUE,
gryffindor_score INT NOT NULL,
ravenclaw_score INT NOT NULL,
hufflepuff_score INT NOT NULL,
slythering_score INT NOT NULL,
last_success VARCHAR(100) NOT NULL ,
PRIMARY KEY (chat_id)
);
CREATE TABLE IF NOT EXISTS hogwartsPlayerNickname (
user_id BIGINT NOT NULL UNIQUE,
name VARCHAR(64) NOT NULL,
PRIMARY KEY (user_id)
);
CREATE TABLE IF NOT EXISTS hogwartsCheat (
user_id BIGINT NOT NULL UNIQUE,
magic_value BIGINT NOT NULL,
time_stamp BIGINT NOT NULL,
PRIMARY KEY (user_id)
);