用户表:users 列名 user_id user_name password email age school address sex state 类型 INT(8) VARCHAR(20) INT(8) 约束 NOT NULL NOT NULL 键 主键 描述 自增 登录的状态 VARCHAR(40) NOT NULL VARCHAR(128) Unique VARCHAR(100) VARCHAR(100) CARCHAR(10) Tinyint CHECK OPTION 男 女 Check option Tinyint(1) Tinyint(0) Birthday Telephone Picture
Date Varchar(25) Varchar(128) 用户头像的路径 好友关系表:friends
列名 my_id friend_id State 类型 INT(8) INT(8) Tinyint 约束 NOT NULL Not null Check option Tinyint(0) Tinyint(1) 键 主键/外键(users) 外键 描述 参照users表 参照users表 0:接听 1:朋友
消息表:messages
列名 Message_id From_id To_id content Type 类型 INT(8) INT(8) INT(8) Varchar(300) Int(2) 约束 NOT NULL Not null Not null Check option In(0,1,2) 键 主键 外键 外键 描述 自增 参照users表 参照users表 留言的内容 消息类别 注:当Type==0时是系统消息 Type==1时好友申请消息
Type==2时是留言板消息
活动表:activitys
列名 Activity_id owner_id Create_date End_date Address Max_num State Topic Content Current_num
类型 Int(8) Int(8) Timestamp Timestamp Varchar(128) Int(8) Varchar(8) Varchar(128) Varchar(512) Int(8) 约束 Not null Not null Not null Not null Not null Not null Not null Not null 键 主键 外键 描述 自增 发起者 创建时间 结束时间 活动地点 最大人数 当前活动状态 活动主题 活动描述 当前参与人数 用户---活动关系表:joins
列名 Activity_id Joiner_id Jion_time
类型 Int(8) Int(8) timestamp 约束 Not null Not null Not null 键 主键/外键 外键 描述 参照activitys 参照users表 加入时间 动态表:news
列名 New_id Owner_id Create_date Content_text Picture Video Comment_num Share_num Type 类型 Int(8) Int(8) timestamp Varchar(512) Varchar(128) Varchar(128) Int(8) Int(8) Int(2) 约束 Not null Not null Not null Not null Not null Check option In(0,1,2) 键 主键 外键 描述 自增 发布者的id 发布时间 发布的文字内容 图片的url 视频的url 评论的人数 分享人数 0:日志 1:图片 2:视频
评论表:comments
列名 Commnet_id New_id Content Commenter_id Create_date ,类型 Int(8) Int(8) Varchar(521) Int(8) timestamp 约束 非空 非空 Not null 非空 非空 键 主键 外键 外键 描述 自增 参照news表 评论的内容 参照users表 创建时间
注:把对评论的回复当做一条评论,commnet.commenter_id==news.owner_id
时就表示是回复,否则为浏览者的评论。
敏感词表:words
列名 Word_id Word Replace
类型 Int(8) Varchar(20) Varchar(20) 约束 Not null Not null Not null 键 主键 Not null Not null 描述 自增 敏感词 替代词