-
Notifications
You must be signed in to change notification settings - Fork 2
/
database.sql
68 lines (68 loc) · 2.02 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
CREATE DATABASE IF NOT EXISTS `Discord` /*!40100 DEFAULT CHARACTER SET utf8mb3 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `Discord`;
CREATE TABLE `message` (
`message_index` int NOT NULL AUTO_INCREMENT,
`fromId` varchar(200) DEFAULT NULL,
`toId` varchar(200) DEFAULT NULL,
`timestamp` timestamp NULL DEFAULT NULL,
`type` smallint DEFAULT NULL,
`message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
`data` json DEFAULT NULL,
`seen` bit(1) DEFAULT NULL,
`edited` bit(1) DEFAULT NULL,
PRIMARY KEY (`message_index`)
);
USE `Discord`;
CREATE TABLE `opened_chats` (
`opened_chats_index` int NOT NULL AUTO_INCREMENT,
`ownerId` varchar(200) DEFAULT NULL,
`userId` varchar(200) DEFAULT NULL,
PRIMARY KEY (`opened_chats_index`)
);
USE `Discord`;
CREATE TABLE `server` (
`index` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`channels` json DEFAULT NULL,
`owner` varchar(45) DEFAULT NULL,
`image` text,
`permissions` int DEFAULT NULL,
`serverId` varchar(45) DEFAULT NULL,
`inviteCode` varchar(45) DEFAULT NULL,
PRIMARY KEY (`index`),
UNIQUE KEY `id_UNIQUE` (`index`)
);
USE `Discord`;
CREATE TABLE `user_servers` (
`id` int NOT NULL AUTO_INCREMENT,
`server_id` varchar(45) DEFAULT NULL,
`user_id` varchar(45) DEFAULT NULL,
`permissions` int DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
);
USE `Discord`;
CREATE TABLE `friendships` (
`friendships_index` int NOT NULL AUTO_INCREMENT,
`fromId` varchar(200) DEFAULT NULL,
`toId` varchar(200) DEFAULT NULL,
`status` bit(1) DEFAULT NULL,
PRIMARY KEY (`friendships_index`)
);
USE `Discord`;
CREATE TABLE `blocked` (
`index` int NOT NULL AUTO_INCREMENT,
`fromId` varchar(45) DEFAULT NULL,
`toId` varchar(45) DEFAULT NULL,
PRIMARY KEY (`index`),
UNIQUE KEY `index_UNIQUE` (`index`)
);
USE `Discord`;
CREATE TABLE `bot` (
`index` int NOT NULL AUTO_INCREMENT,
`client_id` varchar(45) DEFAULT NULL,
`link` varchar(300) DEFAULT NULL,
PRIMARY KEY (`index`),
UNIQUE KEY `index_UNIQUE` (`index`)
);
USE `Discord`;