-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtables.sql
36 lines (29 loc) · 1.18 KB
/
tables.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
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE `comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`createdAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`body` text CHARACTER SET ascii NOT NULL,
`token` char(50) CHARACTER SET ascii NOT NULL,
PRIMARY KEY (`createdAt`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `keys` (
`Username` varchar(30) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
`pub_key` blob NOT NULL,
`secret_data` blob NOT NULL,
`write_token` varchar(1024) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
PRIMARY KEY (`Username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`createdAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`body` text CHARACTER SET ascii NOT NULL,
`token` char(50) CHARACTER SET ascii NOT NULL,
PRIMARY KEY (`createdAt`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;