-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxyblog.sql
More file actions
118 lines (102 loc) · 3.82 KB
/
xyblog.sql
File metadata and controls
118 lines (102 loc) · 3.82 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE = ''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0 */;
/*!40101 SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES = @@SQL_NOTES, SQL_NOTES = 0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS */`xuyang` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `xuyang`;
drop table if exists `t_blog`;
create table `t_blog`
(
`id` bigint(20) not null auto_increment,
`picture` varchar(225) default null,
`title` varchar(225) default null,
`content` longtext,
`views` int(11) default null,
`comment_count` int(11) default null,
`update_time` datetime default null,
`commentable` bit(1) default null,
`recommend` bit(1) default null,
`type_id` bigint(20) default null,
`description` varchar(225) default null,
primary key (`id`) using btree,
key `type_id` (`type_id`) using btree,
constraint `type_id` foreign key (`type_id`) references `t_type` (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 9
default charset = utf8
row_format = dynamic;
drop table if exists `t_type`;
create table `t_type`
(
`id` bigint(20) not null auto_increment,
`name` varchar(225) not null,
primary key (`id`) using btree
) engine = InnoDB
auto_increment = 2
default charset = utf8
row_format = dynamic;
drop table if exists `t_comment`;
create table `t_comment`
(
`id` bigint(20) not null auto_increment,
`email` varchar(225) default null,
`nick_name` varchar(225) default null,
`content` longtext,
`avatar` varchar(225) default null,
`create_time` datetime default null,
`blog_id` bigint(20) default null,
`parent_comment_id` bigint(20) default null,
`parent_nick_name` varchar(225) default null,
`admin_comment` bit(1) default null,
primary key (`id`) using btree
) engine = InnoDB
auto_increment = 2
default charset = utf8
row_format = dynamic;
drop table if exists `t_friend`;
create table `t_friend`
(
`id` bigint(20) not null auto_increment,
`link_des` varchar(225) default null,
`link_address` varchar(225) default null,
`avatar` varchar(225) default null,
primary key (`id`) using btree
) engine = InnoDB
auto_increment = 2
default charset = utf8
row_format = dynamic;
drop table if exists `t_message`;
create table `t_message`
(
`id` bigint(20) not null auto_increment,
`email` varchar(225) default null,
`nick_name` varchar(225) default null,
`content` longtext,
`avatar` varchar(225) default null,
`create_time` datetime default null,
`parent_message_id` bigint(20) default null,
`parent_nick_name` varchar(225) default null,
`admin_message` bit(1) default null,
primary key (`id`) using btree
) engine = InnoDB
auto_increment = 2
default charset = utf8
row_format = dynamic;
drop table if exists `t_user`;
create table `t_user`
(
`id` bigint(20) not null auto_increment,
`nick_name` varchar(225) default null,
`user_name` varchar(225) default null,
`pass_word` varchar(225) default null,
`email` varchar(225) default null,
`avatar` varchar(225) default null,
`is_admin` int(11) default null,
`create_time` datetime default null,
PRIMARY KEY (`id`) using btree
) ENGINE = InnoDB
AUTO_INCREMENT = 2
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC;