-
Notifications
You must be signed in to change notification settings - Fork 88
/
schema.sql
30 lines (28 loc) · 836 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
27
28
29
30
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`last_login` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
);
CREATE TABLE `bookmarks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`url` text,
`private` tinyint(4) DEFAULT '0',
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `userIdIdx` (`user_id`)
);
CREATE TABLE `tags` (
`bookmark_id` int(11) DEFAULT NULL,
`tag` varchar(255) DEFAULT NULL,
KEY `bookmarkIdIdx` (`bookmark_id`),
KEY `tagIdx` (`tag`)
);