forked from liuxiaoping910818/ssm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog.sql
77 lines (68 loc) · 2.44 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
/*
Navicat MySQL Data Transfer
Source Server : conn
Source Server Version : 50621
Source Host : localhost:3306
Source Database : blog
Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2016-03-31 10:43:43
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for b_blog
-- ----------------------------
DROP TABLE IF EXISTS `b_blog`;
CREATE TABLE `b_blog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) DEFAULT NULL COMMENT '标题',
`des` varchar(500) DEFAULT NULL COMMENT '简介',
`context` longtext COMMENT '内容',
`userId` int(11) NOT NULL DEFAULT '0' COMMENT '作者id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='博客表';
-- ----------------------------
-- Table structure for b_role
-- ----------------------------
DROP TABLE IF EXISTS `b_role`;
CREATE TABLE `b_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='用户角色表';
-- ----------------------------
-- Table structure for b_user
-- ----------------------------
DROP TABLE IF EXISTS `b_user`;
CREATE TABLE `b_user` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL COMMENT '用户名',
`password` varchar(100) DEFAULT NULL COMMENT '密码',
`level` int(10) DEFAULT NULL COMMENT '等级',
`des` varchar(200) DEFAULT NULL COMMENT '简介',
`tel` varchar(200) DEFAULT NULL COMMENT '电话',
`address` varchar(200) DEFAULT NULL COMMENT '地址',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='用户表';
-- ----------------------------
-- Table structure for b_user_blog
-- ----------------------------
DROP TABLE IF EXISTS `b_user_blog`;
CREATE TABLE `b_user_blog` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`userId` int(20) DEFAULT NULL,
`roleId` int(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户-博客对应表';
-- ----------------------------
-- Table structure for b_user_role
-- ----------------------------
DROP TABLE IF EXISTS `b_user_role`;
CREATE TABLE `b_user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`roleId` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用户角色对应表';