forked from AltriPendragon/Myblog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmyblog.sql
177 lines (163 loc) · 5.93 KB
/
myblog.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
177
/*
Navicat MySQL Data Transfer
Source Server : 47.106.74.95
Source Server Version : 50642
Source Host : 47.106.74.95:3306
Source Database : myblog
Target Server Type : MYSQL
Target Server Version : 50642
File Encoding : 65001
Date: 2019-07-08 10:44:51
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
`article_id` bigint(20) NOT NULL AUTO_INCREMENT,
`author` varchar(255) DEFAULT NULL,
`create_time` varchar(255) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`summary` varchar(255) DEFAULT NULL,
`content` longtext,
`type` varchar(255) DEFAULT NULL,
`category` varchar(255) DEFAULT NULL,
`tags` varchar(255) DEFAULT NULL,
`read` tinyint(4) DEFAULT NULL,
`comment` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`article_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`comment_id` bigint(20) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`remarker_id` int(11) DEFAULT NULL,
`responsor_id` int(11) DEFAULT NULL,
`p_id` bigint(20) DEFAULT NULL,
`comment_content` varchar(255) DEFAULT NULL,
`likes` int(11) DEFAULT NULL,
`comment_date` varchar(20) DEFAULT NULL,
`is_read` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`comment_id`),
KEY `comment_article` (`article_id`),
CONSTRAINT `comment_article` FOREIGN KEY (`article_id`) REFERENCES `article` (`article_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for comment_likes_record
-- ----------------------------
DROP TABLE IF EXISTS `comment_likes_record`;
CREATE TABLE `comment_likes_record` (
`record_id` bigint(20) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`comment_id` bigint(20) DEFAULT NULL,
`liker_id` bigint(20) DEFAULT NULL,
`flag` tinyint(4) DEFAULT NULL,
`date` varchar(20) DEFAULT NULL,
PRIMARY KEY (`record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for leave_message
-- ----------------------------
DROP TABLE IF EXISTS `leave_message`;
CREATE TABLE `leave_message` (
`message_id` bigint(20) NOT NULL AUTO_INCREMENT,
`remarker_id` bigint(20) DEFAULT NULL,
`responsor_id` bigint(20) DEFAULT NULL,
`p_id` bigint(20) DEFAULT NULL,
`message` varchar(255) DEFAULT NULL,
`likes` int(11) DEFAULT NULL,
`message_date` varchar(20) DEFAULT NULL,
`is_read` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`message_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for leave_message_likes_record
-- ----------------------------
DROP TABLE IF EXISTS `leave_message_likes_record`;
CREATE TABLE `leave_message_likes_record` (
`record_id` bigint(20) NOT NULL AUTO_INCREMENT,
`message_id` bigint(20) DEFAULT NULL,
`liker_id` bigint(20) DEFAULT NULL,
`flag` tinyint(4) DEFAULT NULL,
`date` varchar(20) DEFAULT NULL,
PRIMARY KEY (`record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for link
-- ----------------------------
DROP TABLE IF EXISTS `link`;
CREATE TABLE `link` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(24) DEFAULT NULL,
`introduce` varchar(48) DEFAULT NULL,
`url` varchar(24) DEFAULT NULL,
`headImg` varchar(255) DEFAULT NULL,
`status` tinyint(2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for link_message
-- ----------------------------
DROP TABLE IF EXISTS `link_message`;
CREATE TABLE `link_message` (
`link_id` bigint(20) NOT NULL AUTO_INCREMENT,
`remarker_id` bigint(20) DEFAULT NULL,
`responsor_id` bigint(20) DEFAULT NULL,
`p_id` bigint(20) DEFAULT NULL,
`message` varchar(255) DEFAULT NULL,
`likes` int(11) DEFAULT NULL,
`message_date` varchar(20) DEFAULT NULL,
`is_read` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`link_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for link_message_likes_record
-- ----------------------------
DROP TABLE IF EXISTS `link_message_likes_record`;
CREATE TABLE `link_message_likes_record` (
`record_id` bigint(20) NOT NULL AUTO_INCREMENT,
`link_id` bigint(20) DEFAULT NULL,
`liker_id` bigint(20) DEFAULT NULL,
`flag` tinyint(4) DEFAULT NULL,
`date` varchar(255) DEFAULT NULL,
PRIMARY KEY (`record_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`provider_id` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`gender` tinyint(4) DEFAULT NULL,
`info` varchar(255) DEFAULT NULL,
`image_url` varchar(255) DEFAULT NULL,
`role` varchar(255) DEFAULT NULL,
`recent_login_date` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for UserConnection
-- ----------------------------
DROP TABLE IF EXISTS `UserConnection`;
CREATE TABLE `UserConnection` (
`userId` varchar(255) NOT NULL,
`providerId` varchar(255) NOT NULL,
`providerUserId` varchar(255) NOT NULL,
`rank` int(11) NOT NULL,
`displayName` varchar(255) DEFAULT NULL,
`profileUrl` varchar(512) DEFAULT NULL,
`imageUrl` varchar(512) DEFAULT NULL,
`accessToken` varchar(512) NOT NULL,
`secret` varchar(512) DEFAULT NULL,
`refreshToken` varchar(512) DEFAULT NULL,
`expireTime` bigint(20) DEFAULT NULL,
PRIMARY KEY (`userId`,`providerId`,`providerUserId`),
UNIQUE KEY `UserConnectionRank` (`userId`,`providerId`,`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;