首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

连载2:一个论坛还需要那些表

2012-12-23 
连载二:一个论坛还需要那些表#论坛分类表create table Category (??????? id integer not null auto_incre

连载二:一个论坛还需要那些表

#论坛分类表
create table Category (
??????? id integer not null auto_increment,
??????? name varchar(255),
??????? primary key (id)
??? ) type=InnoDB
#论坛 回帖表
??? create table Reply (
??????? id integer not null auto_increment,
??????? content varchar(255),
??????? publistime datetime,
??????? upload varchar(255),#上传文件在服务器路径
??????? theme_id integer,
??????? user_id integer,
??????? primary key (id)
??? ) type=InnoDB
23:55:48,984 DEBUG SchemaExport:377 -
#主题表
??? create table Theme (
??????? id integer not null auto_increment,
??????? content longtext,
??????? publistime datetime,
??????? title varchar(255),
??????? upload varchar(255),#上传文件在服务器路径
??????? category_id integer,
??????? user_id integer,
??????? primary key (id)
??? ) type=InnoDB
23:55:49,031 DEBUG SchemaExport:377 -
#用户表
??? create table User (
??????? id integer not null auto_increment,
??????? Grade int default 1,
??????? email varchar(255),
??????? password varchar(255) default 'image/no.gif',
??????? photopath varchar(255),
??????? username varchar(255),
??????? primary key (id)
??? ) type=InnoDB
23:55:49,093 DEBUG SchemaExport:377 -
#建立 回复 与 主题 多对一关联
??? alter table Reply
??????? add index FK4B322CAFD433C12 (theme_id),
??????? add constraint FK4B322CAFD433C12
??????? foreign key (theme_id)
??????? references Theme (id)
23:55:49,171 DEBUG SchemaExport:377 -
#建立 回复 与 用户 多对一关联
??? alter table Reply
??????? add index FK4B322CA70E20FE2 (user_id),
??????? add constraint FK4B322CA70E20FE2
??????? foreign key (user_id)
??????? references User (id)
23:55:49,281 DEBUG SchemaExport:377 -
#建立 主题 与 用户 多对一关联
??? alter table Theme
??????? add index FK4D085A970E20FE2 (user_id),
??????? add constraint FK4D085A970E20FE2
??????? foreign key (user_id)
??????? references User (id)
23:55:49,390 DEBUG SchemaExport:377 -
#建立 主题 与 类别 多对一关联
??? alter table Theme
??????? add index FK4D085A999815B02 (category_id),
??????? add constraint FK4D085A999815B02
??????? foreign key (category_id)
??????? references Category (id)

**************************************************

?

感谢大家对我 的帮助 ?这是我论坛的 ?数据库的设计 ?希望大家能够提出帮助与意见

我会很快改正

1 楼 psjay 2011-02-21   用户组,权限,系统设置 2 楼 gwisoft 2011-02-21   建议去看一下jive项目,对你一定有帮助。 3 楼 yzyspy 2011-02-21   psjay 写道用户组,权限,系统设置


权限 我感觉 对我来说难度有点大  我想先 尽快 做出一个
1.0版   把Ajax的效果多用一些 

您说的  系统设置???能否举个例子啊??



4 楼 liubey 2011-02-21   yzyspy 写道psjay 写道用户组,权限,系统设置


权限 我感觉 对我来说难度有点大  我想先 尽快 做出一个
1.0版   把Ajax的效果多用一些 

您说的  系统设置???能否举个例子啊??




就跟浏览器或者任意一个软件都有的设置选项一样 5 楼 fly2never 2011-02-22   别在这个版块发,要被隐藏。去入门版块里面发吧 6 楼 cheney_love 2011-02-22   短消息,积分,等级等 7 楼 alyouge 2011-02-22   upload varchar(255),#上传文件在服务器路径
==========================================

要是上传多个文件咋办?

热点排行