-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
26 lines (26 loc) · 827 Bytes
/
schema.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
CREATE TABLE `User` (
`id` int NOT NULL AUTO_INCREMENT,
`email` varchar(191) NOT NULL,
`password` varchar(191) NOT NULL,
`name` varchar(191) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `User_email_key` (`email`)
);
CREATE TABLE `Channel` (
`id` varchar(191) NOT NULL,
`name` varchar(191) NOT NULL,
`createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
`updatedAt` datetime(3) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `Channel_name_key` (`name`)
);
CREATE TABLE `Message` (
`id` int NOT NULL AUTO_INCREMENT,
`content` varchar(191) NOT NULL,
`createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
`updatedAt` datetime(3) NOT NULL,
`deletedAt` datetime(3),
`userId` int NOT NULL,
`channelId` varchar(191) NOT NULL,
PRIMARY KEY (`id`)
);