-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog.sql
176 lines (157 loc) · 8.46 KB
/
blog.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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80025
Source Host : localhost:3308
Source Schema : blog
Target Server Type : MySQL
Target Server Version : 80025
File Encoding : 65001
Date: 12/07/2021 17:51:15
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for blog
-- ----------------------------
DROP TABLE IF EXISTS `blog`;
CREATE TABLE `blog` (
`id` int NOT NULL AUTO_INCREMENT,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`content` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`flag` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`views` int NULL DEFAULT NULL,
`appreciation` bit(1) NULL DEFAULT NULL,
`share_statement` bit(1) NULL DEFAULT NULL,
`commentabled` bit(1) NULL DEFAULT NULL,
`published` bit(1) NULL DEFAULT NULL,
`recommend` bit(1) NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT NULL,
`description` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`type_id` int NULL DEFAULT NULL,
`user_id` int NULL DEFAULT NULL,
`first_picture` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `type_id`(`type_id`) USING BTREE,
INDEX `user_id`(`user_id`) USING BTREE,
CONSTRAINT `blog_ibfk_1` FOREIGN KEY (`type_id`) REFERENCES `type` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of blog
-- ----------------------------
INSERT INTO `blog` VALUES (7, '关于本站和博主', '首先感谢访问我的博客。\r\n### 关于作者\r\n- 基本信息: shadow, 00后。\r\n- 爱好: 篮球,编程,看电影。\r\n- 联系我:[email protected]\r\n### 关于本站V1.0\r\n- 本站采用springboot+jpa+mysql创建\r\n- 爱好: 篮球,编程,看电影。\r\n- 前端采用 semantic-ui\r\n### 关于本站V1.0\r\n- 本站采用SpringBoot+mybatis-plus+mysql创建\r\n- 前端采用 semantic-ui\r\n### 最后\r\n- 人的记忆是不牢固的,但文字记录的东西是不会消失的。\r\n\r\n- 记录自己生活,自己的学习进程,也是一件很美好的事情。\r\n\r\n- 祝每一个陌生人,都能得到自己想要的东西\r\n', '原创', 22, b'1', b'1', b'1', b'1', b'1', '2021-07-11 19:00:07', '2021-07-12 17:47:27', '终于完成了自己的博客网站搭建。这篇博客简单的介绍了网站搭建使用到的技术和搭建过程,欢迎大家来讨论。', 34, 1, 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fcdn.duitang.com%2Fuploads%2Fitem%2F201303%2F29%2F20130329205806_kTTnv.thumb.700_0.jpeg&refer=http%3A%2F%2Fcdn.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1628473631&t=1b7bf5314e488e0babccc42077453422');
-- ----------------------------
-- Table structure for blog_tag
-- ----------------------------
DROP TABLE IF EXISTS `blog_tag`;
CREATE TABLE `blog_tag` (
`blog_id` int NULL DEFAULT NULL,
`tag_id` int NULL DEFAULT NULL,
INDEX `blog_tag_ibfk_1`(`blog_id`) USING BTREE,
INDEX `blog_tag_ibfk_2`(`tag_id`) USING BTREE,
CONSTRAINT `blog_tag_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_tag_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of blog_tag
-- ----------------------------
INSERT INTO `blog_tag` VALUES (7, 18);
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`id` int NOT NULL AUTO_INCREMENT,
`nickname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`content` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT NULL,
`blog_id` int NULL DEFAULT NULL,
`parent_id` int NULL DEFAULT NULL,
`admin_comment` bit(1) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `comment_ibfk_1`(`parent_id`) USING BTREE,
INDEX `comment_ibfk_2`(`blog_id`) USING BTREE,
CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `comment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `comment_ibfk_2` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of comment
-- ----------------------------
-- ----------------------------
-- Table structure for img
-- ----------------------------
DROP TABLE IF EXISTS `img`;
CREATE TABLE `img` (
`id` int NOT NULL AUTO_INCREMENT,
`local_img` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`virtual_img` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`tag_id` int NULL DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`description` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `tag_id`(`tag_id`) USING BTREE,
CONSTRAINT `img_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of img
-- ----------------------------
-- ----------------------------
-- Table structure for tag
-- ----------------------------
DROP TABLE IF EXISTS `tag`;
CREATE TABLE `tag` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tag
-- ----------------------------
INSERT INTO `tag` VALUES (15, 'javascript');
INSERT INTO `tag` VALUES (16, 'java');
INSERT INTO `tag` VALUES (17, '算法');
INSERT INTO `tag` VALUES (18, '关于本站');
-- ----------------------------
-- Table structure for type
-- ----------------------------
DROP TABLE IF EXISTS `type`;
CREATE TABLE `type` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 35 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of type
-- ----------------------------
INSERT INTO `type` VALUES (29, '前端');
INSERT INTO `type` VALUES (30, '后端');
INSERT INTO `type` VALUES (32, '操作系统');
INSERT INTO `type` VALUES (33, '数据结构');
INSERT INTO `type` VALUES (34, '关于本站');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int NOT NULL AUTO_INCREMENT,
`nickname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT NULL,
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, '何孝林', 'e10adc3949ba59abbe56e057f20f883e', '[email protected]', '/images/admin.jpeg', NULL, '2021-07-07 19:37:57', '2021-07-07 19:38:00', 'hxl');
SET FOREIGN_KEY_CHECKS = 1;