forked from erusev/base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sql
66 lines (55 loc) · 1.76 KB
/
test.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Dump of table post
# ------------------------------------------------------------
CREATE TABLE `post` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`text` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `post` (`id`, `user_id`, `title`, `text`)
VALUES
(1,1,'First Post','This is a post about literature.'),
(2,1,'Second Post','This is a post about literature and history.'),
(3,2,'Third Post','This is a post about history.'),
(4,2,'Fourth Post','This is a post about life.');
# Dump of table post_tag
# ------------------------------------------------------------
CREATE TABLE `post_tag` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`post_id` int(11) DEFAULT NULL,
`tag_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `post_tag` (`id`, `post_id`, `tag_id`)
VALUES
(1,1,1),
(2,2,1),
(3,2,2),
(4,3,2),
(5,4,3);
# Dump of table tag
# ------------------------------------------------------------
CREATE TABLE `tag` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tag` (`id`, `name`)
VALUES
(1,'literature'),
(2,'history'),
(3,'life');
# Dump of table user
# ------------------------------------------------------------
CREATE TABLE `user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`first_name` varchar(255) DEFAULT NULL,
`last_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `user` (`id`, `username`, `first_name`, `last_name`)
VALUES
(1,'john.doe','John','Doe'),
(2,'jane.doe','Jane','Doe');