|
|
|
@ -1,199 +1,477 @@
|
|
|
|
|
create DATABASE mydoc;
|
|
|
|
|
use mydoc;
|
|
|
|
|
create table article (
|
|
|
|
|
id varchar(64) not null PRIMARY key comment '文章id',
|
|
|
|
|
user_id varchar(64) not null comment '作者id',
|
|
|
|
|
status int(4) default 1 comment '显示状态 0 私密 1 公开 2不显示 3删除',
|
|
|
|
|
original int(4) comment '原创 0 原创 1 转载',
|
|
|
|
|
reprint_link varchar(100) comment '转载来源链接url',
|
|
|
|
|
examine_status int(4) comment '文章审核状态 0 待审核 1 已审核 2、已驳回',
|
|
|
|
|
examine_time datetime comment '文章审核时间',
|
|
|
|
|
browse_num int(11) comment '浏览次数',
|
|
|
|
|
fabulous_num int(11) comment '点赞次数',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
update_time datetime comment '更新时间'
|
|
|
|
|
);
|
|
|
|
|
/*
|
|
|
|
|
Navicat Premium Data Transfer
|
|
|
|
|
|
|
|
|
|
create table article_information (
|
|
|
|
|
id varchar(64) NOT NULL PRIMARY KEY,
|
|
|
|
|
article_id varchar(64) not null comment '文章id',
|
|
|
|
|
content_id varchar(64) not null comment '内容id',
|
|
|
|
|
user_id varchar(64) not null comment '用户id',
|
|
|
|
|
classify_id varchar(64) comment '分类id',
|
|
|
|
|
tag_id varchar(64) comment '标签id',
|
|
|
|
|
type_id int(4) comment '文章类型表id'
|
|
|
|
|
);
|
|
|
|
|
Source Server : mysql57
|
|
|
|
|
Source Server Type : MySQL
|
|
|
|
|
Source Server Version : 50732
|
|
|
|
|
Source Host : localhost:3306
|
|
|
|
|
Source Schema : mydoc
|
|
|
|
|
|
|
|
|
|
create table article_content (
|
|
|
|
|
id varchar(64) comment '内容id',
|
|
|
|
|
content longtext default null COMMENT '内容'
|
|
|
|
|
);
|
|
|
|
|
Target Server Type : MySQL
|
|
|
|
|
Target Server Version : 50732
|
|
|
|
|
File Encoding : 65001
|
|
|
|
|
|
|
|
|
|
create table article_classify (
|
|
|
|
|
id varchar(64) not null primary key comment '分类id',
|
|
|
|
|
parent_id varchar(64) default 0 comment '父分类id 若为0则父分类',
|
|
|
|
|
name varchar(64) comment '分类名称',
|
|
|
|
|
status int comment '状态 0删除/弃用 1表示使用',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
update_time datetime comment '更新时间'
|
|
|
|
|
);
|
|
|
|
|
create table article_tag (
|
|
|
|
|
id varchar(64) not null primary key comment '标签id',
|
|
|
|
|
name varchar(20) not null comment '标签名称',
|
|
|
|
|
status int(2) default 1 comment '状态 0删除/弃用 1表示使用',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
update_time datetime comment '更新时间'
|
|
|
|
|
);
|
|
|
|
|
Date: 12/01/2021 15:13:42
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
create table article_type (
|
|
|
|
|
id varchar(64) not null primary key comment '文章类型id',
|
|
|
|
|
name varchar(20) comment '文章类型名字',
|
|
|
|
|
user_id varchar(64) comment '创建者 用户id',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
update_time datetime comment '更新时间'
|
|
|
|
|
);
|
|
|
|
|
SET NAMES utf8mb4;
|
|
|
|
|
SET FOREIGN_KEY_CHECKS = 0;
|
|
|
|
|
|
|
|
|
|
create table article_fabulous (
|
|
|
|
|
id varchar(64) not null primary key comment 'id',
|
|
|
|
|
article_id varchar(64) not null comment '文章id',
|
|
|
|
|
user_id varchar(64) not null comment '点赞者 用户id',
|
|
|
|
|
fabulous_time datetime comment '点赞时间'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article`;
|
|
|
|
|
CREATE TABLE `article` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '作者id',
|
|
|
|
|
`status` int(4) NULL DEFAULT 1 COMMENT '显示状态 0 私密 1 公开 2不显示 3删除',
|
|
|
|
|
`original` int(4) NULL DEFAULT NULL COMMENT '原创 0 原创 1 转载',
|
|
|
|
|
`reprint_link` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '转载来源链接url',
|
|
|
|
|
`examine_status` int(4) NULL DEFAULT NULL COMMENT '文章审核状态 0 待审核 1 已审核 2、已驳回',
|
|
|
|
|
`examine_time` datetime(0) NULL DEFAULT NULL COMMENT '文章审核时间',
|
|
|
|
|
`browse_num` int(11) NULL DEFAULT NULL COMMENT '浏览次数',
|
|
|
|
|
`fabulous_num` int(11) NULL DEFAULT NULL COMMENT '点赞次数',
|
|
|
|
|
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '简介',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
create table article_discuss (
|
|
|
|
|
id varchar(64) not null primary key comment '评论表id',
|
|
|
|
|
article_id varchar(64) not null comment '文章id',
|
|
|
|
|
user_id varchar(64) not null comment '评论用户id',
|
|
|
|
|
content nvarchar(500) default NULL comment '评论内容',
|
|
|
|
|
target_user_id varchar(64) not null comment '评论目标用户id',
|
|
|
|
|
discuss_time datetime comment '评论时间'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
create table article_browse (
|
|
|
|
|
id varchar(64) not null primary key comment 'id',
|
|
|
|
|
article_id varchar(64) not null comment '评论表id',
|
|
|
|
|
user_id varchar(64) not null comment '评论用户id',
|
|
|
|
|
browse_time datetime comment '评论时间'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_browse
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_browse`;
|
|
|
|
|
CREATE TABLE `article_browse` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id',
|
|
|
|
|
`article_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '评论表id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '评论用户id',
|
|
|
|
|
`browse_time` datetime(0) NULL DEFAULT NULL COMMENT '评论时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
create table user (
|
|
|
|
|
id varchar(64) not null primary key comment '用户id',
|
|
|
|
|
username varchar(64) not null comment '用户名',
|
|
|
|
|
nickname varchar(64) comment '昵称',
|
|
|
|
|
age int(3) comment '用户年龄',
|
|
|
|
|
avatar varchar(255) DEFAULT NULL COMMENT '头像',
|
|
|
|
|
password varchar(100) comment '用户密码',
|
|
|
|
|
phone int(12) comment '用户密码',
|
|
|
|
|
email varchar(64) comment '邮箱',
|
|
|
|
|
introduction varchar(600) default null comment '用户介绍',
|
|
|
|
|
status int(4) comment '用户状态 0启用 1注销',
|
|
|
|
|
follow_num int(11) comment '关注数量',
|
|
|
|
|
fans_num int(11) comment '粉丝数量',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
update_time datetime comment '更新时间'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_browse
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
create table user_relation (
|
|
|
|
|
id varchar(64) not null primary key comment 'id',
|
|
|
|
|
user_id varchar(64) not null comment '用户id',
|
|
|
|
|
user_tag_id varchar(64) comment '标签id',
|
|
|
|
|
follow_id varchar(64) comment '关注列表id',
|
|
|
|
|
fans_id varchar(64) comment '粉丝列表id',
|
|
|
|
|
collect_id varchar(64) comment '粉丝列表id'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_classify
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_classify`;
|
|
|
|
|
CREATE TABLE `article_classify` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '分类id',
|
|
|
|
|
`parent_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '父分类id 若为0则父分类',
|
|
|
|
|
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称',
|
|
|
|
|
`status` int(11) NULL DEFAULT NULL COMMENT '状态 0删除/弃用 1表示使用',
|
|
|
|
|
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '简介',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
create table user_tag (
|
|
|
|
|
id varchar(64) not null primary key comment '标签id',
|
|
|
|
|
parent_id varchar(64) default null comment '父标签id null 父标签 其余则为子标签 ',
|
|
|
|
|
name varchar(64) comment '标签名称'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_classify
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
create table user_follow (
|
|
|
|
|
id varchar(64) not null primary key comment 'id',
|
|
|
|
|
user_id varchar(64) not null comment '用户id',
|
|
|
|
|
user_follow_id varchar(64) not null comment '关注目标用户id'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_content
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_content`;
|
|
|
|
|
CREATE TABLE `article_content` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容id',
|
|
|
|
|
`content` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '内容'
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
create table user_fans (
|
|
|
|
|
id varchar(64) not null primary key comment 'id',
|
|
|
|
|
user_id varchar(64) not null comment '用户id',
|
|
|
|
|
user_fans_id varchar(64) not null comment '粉丝id'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_content
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
create table user_collect (
|
|
|
|
|
id varchar(64) not null primary key comment '收藏夹id',
|
|
|
|
|
name varchar(64) not null comment '收藏夹名字',
|
|
|
|
|
user_id varchar(64) not null comment '用户id',
|
|
|
|
|
article_id varchar(64) not null comment '文章id'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_discuss
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_discuss`;
|
|
|
|
|
CREATE TABLE `article_discuss` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '评论表id',
|
|
|
|
|
`article_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '评论用户id',
|
|
|
|
|
`content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评论内容',
|
|
|
|
|
`target_user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '评论目标用户id',
|
|
|
|
|
`discuss_time` datetime(0) NULL DEFAULT NULL COMMENT '评论时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
create table user_configure (
|
|
|
|
|
id varchar(64) not null primary key comment '用户配置id',
|
|
|
|
|
user_id varchar(64) not null comment '用户id',
|
|
|
|
|
theme_colour int(4) default 0 comment '主题 0 白色 1黑色',
|
|
|
|
|
theme_background varchar(50) default null comment '系统背景图片 url String',
|
|
|
|
|
editor int default 0 comment '默认编辑器id 0 markdown 1.富文本'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_discuss
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
create table system_configure (
|
|
|
|
|
id varchar(64) not null primary key comment '全局配置表id',
|
|
|
|
|
icp varchar(64) default null comment '备案信息',
|
|
|
|
|
footer varchar(100) default null comment '页脚信息',
|
|
|
|
|
title varchar(50) default '笔记' comment '站点标题',
|
|
|
|
|
subtitle varchar(50) default null comment '站点副标题',
|
|
|
|
|
site_name varchar(50) default '笔记' comment '站点名称',
|
|
|
|
|
register int(4) default 0 comment '注册是否需要邀请码 0不需要 1需要'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_fabulous
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_fabulous`;
|
|
|
|
|
CREATE TABLE `article_fabulous` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id',
|
|
|
|
|
`article_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '点赞者 用户id',
|
|
|
|
|
`fabulous_time` datetime(0) NULL DEFAULT NULL COMMENT '点赞时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
create table information (
|
|
|
|
|
id varchar(64) not null primary key comment '消息id',
|
|
|
|
|
user_id varchar(64) not null comment '发送者id 发送者为0 则为系统',
|
|
|
|
|
news_content varchar(600) default null comment '内容',
|
|
|
|
|
point_user_id varchar(64) not null comment '目标用户id',
|
|
|
|
|
images varchar(640) default null comment '图片列表',
|
|
|
|
|
send_time datetime comment '发送时间'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_fabulous
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
create table invitation_code (
|
|
|
|
|
id varchar(64) not null primary key comment '邀请码id',
|
|
|
|
|
code varchar(20) not null comment '邀请码',
|
|
|
|
|
status int(2) default 0 comment '状态 0 正常 1失效 ',
|
|
|
|
|
use_times int(4) default 10 comment '可以使用的次数',
|
|
|
|
|
create_id varchar(64) not null comment '创建者id',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
invalid_time datetime comment '失效时间'
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE user_role (
|
|
|
|
|
id varchar(64) NOT NULL PRIMARY KEY comment '用户角色关联表id',
|
|
|
|
|
user_id varchar(64) DEFAULT NULL comment '用户id',
|
|
|
|
|
role_id varchar(64) DEFAULT NULL comment '角色id'
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_information
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_information`;
|
|
|
|
|
CREATE TABLE `article_information` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
|
|
|
|
`article_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章id',
|
|
|
|
|
`content_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内容id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
|
|
|
|
|
`classify_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类id',
|
|
|
|
|
`tag_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签id',
|
|
|
|
|
`type_id` int(4) NULL DEFAULT NULL COMMENT '文章类型表id',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE role (
|
|
|
|
|
id varchar(64) NOT NULL primary key comment 'id',
|
|
|
|
|
name varchar(64) DEFAULT NULL comment '角色名字',
|
|
|
|
|
icon varchar(64) DEFAULT NULL comment '角色图标',
|
|
|
|
|
description varchar(64) DEFAULT NULL comment '角色介绍',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
update_time datetime comment '更新时间'
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE menu_role (
|
|
|
|
|
id varchar(64) NOT NULL PRIMARY KEY comment '角色权限关联表id',
|
|
|
|
|
role_id varchar(64) DEFAULT NULL comment '角色id',
|
|
|
|
|
menu_id varchar(64) DEFAULT NULL comment '权限id'
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE menu (
|
|
|
|
|
id varchar(64) NOT NULL primary key comment '权限表id',
|
|
|
|
|
name varchar(64) DEFAULT NULL comment '权限名字',
|
|
|
|
|
icon varchar(64) DEFAULT NULL comment '权限权限图标',
|
|
|
|
|
url varchar(64) DEFAULT NULL comment '权限路径',
|
|
|
|
|
parent_id varchar(64) DEFAULT NULL comment '父节点',
|
|
|
|
|
description varchar(64) DEFAULT NULL comment '介绍',
|
|
|
|
|
create_time datetime comment '创建时间',
|
|
|
|
|
update_time datetime comment '更新时间'
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE user_menu (
|
|
|
|
|
id varchar(64) NOT NULL PRIMARY KEY,
|
|
|
|
|
user_id varchar(64) DEFAULT NULL,
|
|
|
|
|
role_id varchar(64) DEFAULT NULL
|
|
|
|
|
);
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_information
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_tag
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_tag`;
|
|
|
|
|
CREATE TABLE `article_tag` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标签id',
|
|
|
|
|
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标签名称',
|
|
|
|
|
`status` int(2) NULL DEFAULT 1 COMMENT '状态 0删除/弃用 1表示使用',
|
|
|
|
|
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '介绍',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_tag
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for article_type
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `article_type`;
|
|
|
|
|
CREATE TABLE `article_type` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章类型id',
|
|
|
|
|
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章类型名字',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者 用户id',
|
|
|
|
|
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '简介',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of article_type
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for information
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `information`;
|
|
|
|
|
CREATE TABLE `information` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '消息id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '发送者id 发送者为0 则为系统',
|
|
|
|
|
`news_content` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容',
|
|
|
|
|
`point_user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '目标用户id',
|
|
|
|
|
`images` varchar(640) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片列表',
|
|
|
|
|
`send_time` datetime(0) NULL DEFAULT NULL COMMENT '发送时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of information
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for invitation_code
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `invitation_code`;
|
|
|
|
|
CREATE TABLE `invitation_code` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '邀请码id',
|
|
|
|
|
`code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '邀请码',
|
|
|
|
|
`status` int(2) NULL DEFAULT 0 COMMENT '状态 0 正常 1失效 ',
|
|
|
|
|
`use_times` int(4) NULL DEFAULT 10 COMMENT '可以使用的次数',
|
|
|
|
|
`create_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建者id',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`invalid_time` datetime(0) NULL DEFAULT NULL COMMENT '失效时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of invitation_code
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for menu
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `menu`;
|
|
|
|
|
CREATE TABLE `menu` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '权限表id',
|
|
|
|
|
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限名字',
|
|
|
|
|
`icon` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限权限图标',
|
|
|
|
|
`url` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限路径',
|
|
|
|
|
`type` int(4) NOT NULL COMMENT '类型 0菜单 1按钮',
|
|
|
|
|
`parent_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父节点',
|
|
|
|
|
`description` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '介绍',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of menu
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
INSERT INTO `menu` VALUES ('1', '系统管理员权限', NULL, '/**', 0, NULL, '所有权限', '2021-01-06 18:18:55', '2021-01-06 18:18:57');
|
|
|
|
|
INSERT INTO `menu` VALUES ('2', '系统菜单', NULL, NULL, 0, '-1', '系统菜单', '2021-01-08 10:12:31', '2021-01-08 10:12:34');
|
|
|
|
|
INSERT INTO `menu` VALUES ('3', '文章管理', NULL, '/article', 0, '2', '文章管理', '2021-01-08 10:12:26', '2021-01-08 10:12:29');
|
|
|
|
|
INSERT INTO `menu` VALUES ('4', '添加', NULL, '/add/**', 1, '3', '添加文章', NULL, NULL);
|
|
|
|
|
INSERT INTO `menu` VALUES ('5', '修改', NULL, '/edit/**', 1, '3', '修改文章', NULL, NULL);
|
|
|
|
|
INSERT INTO `menu` VALUES ('6', '系统管理', NULL, '/system', 0, '2', '系统管理', NULL, NULL);
|
|
|
|
|
INSERT INTO `menu` VALUES ('7', '消息管理', NULL, '/infomation', 0, '2', '消息管理', NULL, NULL);
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for menu_role
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `menu_role`;
|
|
|
|
|
CREATE TABLE `menu_role` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色权限关联表id',
|
|
|
|
|
`role_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色id',
|
|
|
|
|
`menu_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限id',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of menu_role
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
INSERT INTO `menu_role` VALUES ('1', '1', '1');
|
|
|
|
|
INSERT INTO `menu_role` VALUES ('2', '2', '2');
|
|
|
|
|
INSERT INTO `menu_role` VALUES ('3', '2', '3');
|
|
|
|
|
INSERT INTO `menu_role` VALUES ('4', '2', '4');
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for persistent_logins
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `persistent_logins`;
|
|
|
|
|
CREATE TABLE `persistent_logins` (
|
|
|
|
|
`username` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
|
|
|
|
`series` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
|
|
|
|
`token` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
|
|
|
|
`last_used` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0),
|
|
|
|
|
PRIMARY KEY (`series`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of persistent_logins
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for role
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `role`;
|
|
|
|
|
CREATE TABLE `role` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id',
|
|
|
|
|
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名字',
|
|
|
|
|
`icon` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色图标',
|
|
|
|
|
`description` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色介绍',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of role
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
INSERT INTO `role` VALUES ('1', '系统管理员', NULL, '系统管理员', '2021-01-06 18:22:54', '2021-01-06 18:22:57');
|
|
|
|
|
INSERT INTO `role` VALUES ('2', 'test', NULL, 'test', NULL, NULL);
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for system_configure
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `system_configure`;
|
|
|
|
|
CREATE TABLE `system_configure` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '全局配置表id',
|
|
|
|
|
`icp` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备案信息',
|
|
|
|
|
`footer` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页脚信息',
|
|
|
|
|
`title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '笔记' COMMENT '站点标题',
|
|
|
|
|
`subtitle` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点副标题',
|
|
|
|
|
`site_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '笔记' COMMENT '站点名称',
|
|
|
|
|
`register` int(4) NULL DEFAULT 0 COMMENT '注册是否需要邀请码 0不需要 1需要',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of system_configure
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user`;
|
|
|
|
|
CREATE TABLE `user` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
|
|
|
|
|
`username` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
|
|
|
|
|
`nickname` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称',
|
|
|
|
|
`age` int(11) NULL DEFAULT NULL COMMENT '用户年龄',
|
|
|
|
|
`avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
|
|
|
|
|
`password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户密码',
|
|
|
|
|
`phone` int(12) NULL DEFAULT NULL COMMENT '用户密码',
|
|
|
|
|
`email` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
|
|
|
|
`invite_user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邀请者id',
|
|
|
|
|
`status` int(4) NULL DEFAULT NULL COMMENT '用户状态 1启用 0注销',
|
|
|
|
|
`follow_num` int(6) NULL DEFAULT NULL COMMENT '关注数量',
|
|
|
|
|
`fans_num` int(10) NULL DEFAULT NULL COMMENT '粉丝数量',
|
|
|
|
|
`login_time` datetime(0) NULL DEFAULT NULL COMMENT '登录时间',
|
|
|
|
|
`description` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户介绍',
|
|
|
|
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE,
|
|
|
|
|
UNIQUE INDEX `username`(`username`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
INSERT INTO `user` VALUES ('1', 'zhuyijun', 'nicemoe', 23, NULL, '$2a$10$EQbRCiDDT59P.TdmjngyFucvSrtmpZRS7oQyiMJCVs7ZmPhXcVb3O', 1345411414, '111@qq.com', NULL, 1, 0, 0, '2021-01-02 00:08:12', '1111', '2021-01-02 00:08:15', '2021-01-02 00:08:18');
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_collect
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_collect`;
|
|
|
|
|
CREATE TABLE `user_collect` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '收藏夹id',
|
|
|
|
|
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '收藏夹名字',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
|
|
|
|
|
`article_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章id',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_collect
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_configure
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_configure`;
|
|
|
|
|
CREATE TABLE `user_configure` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户配置id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
|
|
|
|
|
`theme_colour` int(4) NULL DEFAULT 0 COMMENT '主题 0 白色 1黑色',
|
|
|
|
|
`theme_background` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '系统背景图片 url String',
|
|
|
|
|
`editor` int(11) NULL DEFAULT 0 COMMENT '默认编辑器id 0 markdown 1.富文本',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_configure
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_fans
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_fans`;
|
|
|
|
|
CREATE TABLE `user_fans` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
|
|
|
|
|
`user_fans_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '粉丝id',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_fans
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_follow
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_follow`;
|
|
|
|
|
CREATE TABLE `user_follow` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
|
|
|
|
|
`user_follow_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '关注目标用户id',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_follow
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_menu
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_menu`;
|
|
|
|
|
CREATE TABLE `user_menu` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
|
|
|
|
`menu_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_menu
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_relation
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_relation`;
|
|
|
|
|
CREATE TABLE `user_relation` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
|
|
|
|
|
`user_tag_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签id',
|
|
|
|
|
`follow_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关注列表id',
|
|
|
|
|
`fans_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '粉丝列表id',
|
|
|
|
|
`collect_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '粉丝列表id',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_relation
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_role
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_role`;
|
|
|
|
|
CREATE TABLE `user_role` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户角色关联表id',
|
|
|
|
|
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户id',
|
|
|
|
|
`role_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色id',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_role
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
INSERT INTO `user_role` VALUES ('1', '1', '1');
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Table structure for user_tag
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP TABLE IF EXISTS `user_tag`;
|
|
|
|
|
CREATE TABLE `user_tag` (
|
|
|
|
|
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标签id',
|
|
|
|
|
`parent_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父标签id null 父标签 其余则为子标签 ',
|
|
|
|
|
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签名称',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Records of user_tag
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
|
|
|
|
|
SET FOREIGN_KEY_CHECKS = 1;
|
|
|
|
|