-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sql
37 lines (34 loc) · 1.19 KB
/
init.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
CREATE TABLE `records` (
`id` INT unsigned NOT NULL AUTO_INCREMENT,
`playername` VARCHAR(20) NOT NULL,
`type` VARCHAR(10) NOT NULL,
`until` BIGINT unsigned NOT NULL,
`created_by` VARCHAR(20) NOT NULL,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE `distribution` (
`id` INT unsigned NOT NULL AUTO_INCREMENT,
`dist_by` VARCHAR(36) NOT NULL,
`dist_content` TEXT NOT NULL,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE `receipt` (
`id` INT unsigned NOT NULL AUTO_INCREMENT,
`dist_by` VARCHAR(36) NOT NULL,
`recv_by` VARCHAR(36) NOT NULL,
`recv_count` INT unsigned DEFAULT 0,
`recv_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE `delivery` (
`id` INT unsigned NOT NULL AUTO_INCREMENT,
`inst_id` VARCHAR(36) NOT NULL,
`playername` VARCHAR(20) NOT NULL,
`type` VARCHAR(10) NOT NULL,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);