登录 注册

大作业展示

1.功能需求

1.一般博客的基本功能:
博主可以发博文,或者编辑/删除以前发的博文
游客可以注册帐号并且在博文下发表评论
2.由于本人比较喜欢流行音乐,因此设计了博客背景音乐功能,博主可以通过网页界面新增/删除背景音乐

2.ER图

3.逻辑结构


4.数据库设计

CREATE TABLE IF NOT EXISTS `accounts` (
  `uid` int(11) NOT NULL,
  `username` varchar(20) CHARACTER SET utf8 NOT NULL,
  `hash` varchar(32) NOT NULL,
  `mhash` varchar(32) NOT NULL,
  `passwd` varchar(32) NOT NULL,
  `rkey` varchar(32) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `blogs` (
  `tid` int(11) NOT NULL,
  `time` int(11) NOT NULL,
  `title` varchar(100) CHARACTER SET utf8 NOT NULL,
  `content` text CHARACTER SET utf8 NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  `tags` text CHARACTER SET utf8 NOT NULL,
  `reply` int(11) NOT NULL,
  PRIMARY KEY (`tid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `blog_reply` (
  `tid` int(11) NOT NULL,
  `pid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `content` text CHARACTER SET utf8 NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  `timestamp` int(11) NOT NULL,
  `ip` varchar(12) NOT NULL,
  PRIMARY KEY (`pid`),
  FOREIGN KEY (`tid`) REFERENCES `blogs`(`tid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `config` (
  `name` varchar(30) NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `music` (
  `mid` int(11) NOT NULL,
  `ord` int(11) NOT NULL,
  `artist` varchar(50) CHARACTER SET utf8 NOT NULL,
  `album` varchar(50) CHARACTER SET utf8 NOT NULL,
  `name` varchar(50) CHARACTER SET utf8 NOT NULL,
  `url` text CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`mid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `tags` (
  `name` varchar(30) CHARACTER SET utf8 NOT NULL,
  `num` int(11) NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `tags_list` (
  `tag` varchar(50) CHARACTER SET utf8 NOT NULL,
  `blog` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

2016
01 07
上一篇
Older
下一篇
Newer
评论
0
点击
738
发布
我是标题
我是文字
我是标题
我是文字
用户名
密码
用户名
密码
重复密码
努力的加载中.....