forked from Lutils/MyForum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mybbs.sql
79 lines (71 loc) · 2.44 KB
/
mybbs.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
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50716
Source Host : localhost:3306
Source Database : mybbs
Target Server Type : MYSQL
Target Server Version : 50716
File Encoding : 65001
Date: 2017-03-15 14:14:05
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
`aid` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) DEFAULT NULL,
`content` text,
`date` datetime DEFAULT NULL,
`uid` int(11) NOT NULL,
`lable` varchar(100) DEFAULT NULL,
`status` int(10) unsigned zerofill DEFAULT NULL,
PRIMARY KEY (`aid`),
KEY `uid` (`uid`),
CONSTRAINT `uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`cid` int(11) NOT NULL AUTO_INCREMENT,
`content` text,
`aid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`date` datetime DEFAULT NULL,
PRIMARY KEY (`cid`),
KEY `aid` (`aid`),
KEY `uid` (`uid`),
CONSTRAINT `aid` FOREIGN KEY (`aid`) REFERENCES `article` (`aid`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for floor
-- ----------------------------
DROP TABLE IF EXISTS `floor`;
CREATE TABLE `floor` (
`fid` int(11) NOT NULL AUTO_INCREMENT,
`aid` int(11) NOT NULL,
`cid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`content` varchar(255) DEFAULT NULL,
PRIMARY KEY (`fid`),
KEY `cid` (`cid`),
CONSTRAINT `cid` FOREIGN KEY (`cid`) REFERENCES `comment` (`cid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`headimg` varchar(255) DEFAULT NULL,
PRIMARY KEY (`uid`),
KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS=1;