-
Notifications
You must be signed in to change notification settings - Fork 13
/
database.sql
43 lines (36 loc) · 1.52 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
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`profile_fields` text COLLATE utf8_unicode_ci,
`group` int(11) DEFAULT NULL,
`last_login` bigint(20) DEFAULT NULL,
`login_hash` tinytext COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `articles`;
CREATE TABLE `articles` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL DEFAULT '0',
`category_id` int(11) DEFAULT NULL,
`title` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL,
`body` text COLLATE utf8_unicode_ci,
`published` tinyint(3) unsigned NOT NULL DEFAULT '0',
`created_at` bigint(20) unsigned DEFAULT NULL,
`updated_at` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL DEFAULT '0',
`name` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` tinytext COLLATE utf8_unicode_ci,
`created_at` bigint(20) DEFAULT NULL,
`updated_at` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;