5.11-5.14 background completed the database building
1. Construction of database
According to the first half of the week's functional analysis and data needs analysis, the database was established this week as follows:
Data Dictionary-- Set character set SET NAMES GBK; -- -- Create schema tttdb -- DROP DATABASE IF EXISTS `tttdb`; CREATE DATABASE tttdb; USE tttdb; -- -- Table structure for table `tttdb`.`tbl_user` -- DROP TABLE IF EXISTS `tbl_user`; CREATE TABLE `tbl_user` ( `u_id` int(10) unsigned NOT NULL auto_increment, `u_uid` varchar(20) NOT NULL default '', `u_realName` varchar(20) NOT NULL default '', `u_password` varchar(30) NOT NULL default '', `u_gender` tinyint(1) unsigned NOT NULL default '0', `u_email` varchar(50) NOT NULL default '', `u_tel` varchar(15) default NULL, `u_validateCode` varchar(20) NOT NULL default '', `u_loginNum` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`u_id`), UNIQUE KEY `Index_uid` USING BTREE (`u_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `tttdb`.`tbl_team` -- DROP TABLE IF EXISTS `tbl_team`; CREATE TABLE `tbl_team` ( `t_id` int(10) unsigned NOT NULL auto_increment, `t_name` varchar(20) NOT NULL default '', `t_type` varchar(50) NOT NULL default '', `t_intro` varchar(200) default NULL, `t_leader` varchar(20) NOT NULL default '', `t_mnum` int(10) unsigned NOT NULL default '0', `t_hasread` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`t_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `tttdb`.`tbl_classify` -- DROP TABLE IF EXISTS `tbl_classify`; CREATE TABLE `tbl_classify`( `cl_id` int(20) unsigned NOT NULL auto_increment,-- Self-increasing id `cl_name` varchar(30) NOT NULL default '', PRIMARY KEY(`cl_id`,`cl_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `tttdb`.`tbl_member` -- DROP TABLE IF EXISTS `tbl_member`; CREATE TABLE `tbl_member` ( `m_uid` varchar(20) NOT NULL default '', `m_tid` int(10) unsigned, `m_niName` varchar(20) NOT NULL default '', `m_level` int(10) unsigned, `m_time` datetime, PRIMARY KEY (`m_uid`,`m_tid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `tttdb`.`tbl_article` -- DROP TABLE IF EXISTS `tbl_article`; CREATE TABLE `tbl_article` ( `a_id` int(10) unsigned NOT NULL auto_increment, `a_tid` int(10) unsigned, `a_title` varchar(100) NOT NULL default '', `a_content` text, `a_uid` varchar(20) NOT NULL default '', `a_time` datetime, `a_hasread` int(10) unsigned, PRIMARY KEY (`a_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # # Table structure for table tbl_critique # DROP TABLE IF EXISTS `tbl_critique`; CREATE TABLE `tbl_critique` ( `c_id` int(11) NOT NULL auto_increment, `c_aid` int(11) default NULL, `c_content` text, `c_username` varchar(50) default NULL, `c_time` datetime, PRIMARY KEY (`c_id`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; # # Table structure for table tbl_dianjiliang # DROP TABLE IF EXISTS `tbl_dianjiliang`; CREATE TABLE `tbl_dianjiliang` ( `d_id` int(11) NOT NULL auto_increment, `d_aid` int(11) default NULL, `d_ip` varchar(255) default NULL, `d_time` date default NULL, PRIMARY KEY (`d_id`) ) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8; -- -- Table structure for table `tttdb`.`tbl_msg` -- DROP TABLE IF EXISTS `tbl_msg`; CREATE TABLE `tbl_msg` ( `msg_id` int(10) NOT NULL auto_increment, `msg_uid` varchar(20) NOT NULL default '', -- Message recipient `msg_tid` int(10) unsigned, -- Message Object Team `msg_msg` varchar(256) default NULL, `msg_state` int(10) unsigned, -- 0 Read 1 Need Audit Information 2 Read Only Information `msg_time` datetime, `msg_suid` varchar(20) NOT NULL default '', -- message sender PRIMARY KEY (`msg_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `tttdb`.`tbl_plan` -- DROP TABLE IF EXISTS `tbl_plan`; CREATE TABLE `tbl_plan` ( `p_id` int(10) unsigned NOT NULL auto_increment, `p_utid` int(10) unsigned, -- uid or tid `p_curIid` int(10) unsigned, `p_title` varchar(100) NOT NULL default '', `p_content` text, `p_btime` datetime, `p_etime` datetime, `p_state` int(10) unsigned, -- 10 Unstarted 11 in progress 12 completed 20 21 22 correspondence uid PRIMARY KEY (`p_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `tttdb`.`tbl_item` -- DROP TABLE IF EXISTS `tbl_item`; CREATE TABLE `tbl_item` ( `i_id` int(10) unsigned NOT NULL auto_increment, `i_pid` int(10) unsigned, `i_title` varchar(100) NOT NULL default '', `i_content` text, `i_days` int(10) unsigned, `i_state` int(10) unsigned, PRIMARY KEY (`i_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
System entity description extracted from data dictionary
entity |
attribute |
describe |
data type Length and length |
Primary key |
Is it permissible? Null value |
user |
ID |
User ID |
Int 10 |
ID |
no |
Uid |
User name |
Varchar 20 |
no |
||
RealName |
Real name |
Varchar 20 |
no |
||
Password |
Password |
Varchar 30 |
no |
||
Gender |
Gender |
TinyInt 1 |
no |
||
Phone |
Telephone |
Varchar 15 |
yes |
||
|
mailbox |
Varchar 50 |
no |
||
|
LoginNum |
Number of logins |
Int 10 |
|
no |
|
validateCode |
Valid Value Detection |
Varchar 20 |
|
no |
team |
ID |
Team ID |
Int 10 |
ID |
no |
|
Name |
Team name |
Varchar 20 |
|
no |
|
Type |
Team type |
Varchar 50 |
|
no |
|
Intro |
Team Profile |
Varchar 200 |
|
yes |
|
Leader |
Team leader |
Varchar 20 |
|
no |
|
Mnum |
Number of teams |
Int 10 |
|
no |
|
Hasread |
Degree of heat |
Int 10 |
|
no |
member |
Uid |
User ID |
Varchar 20 |
Uid,Tid |
no |
|
Tid |
Team ID |
Int 10 |
|
no |
|
NiName |
Team nickname |
Varchar 20 |
|
no |
|
Level |
Team rank |
Int 10 |
|
yes |
|
Time |
Entry time |
Datetime |
|
yes |
Article |
ID |
Article ID |
Int 10 |
ID |
no |
|
Tid |
Team ID |
Int 10 |
|
yes |
|
Title |
Title of article |
Varchar 100 |
|
no |
|
Content |
Content of the article |
Text |
|
yes |
|
Uid |
User ID |
Varchar 20 |
|
no |
|
Time |
Publication time |
Datetime |
|
yes |
|
Hasread |
Reading volume |
Int 10 |
|
yes |
comment |
ID |
Comment ID |
Int 11 |
ID |
no |
|
Aid |
Article ID |
Int 10 |
|
yes |
|
Uid |
User ID |
Varchar 20 |
|
yes |
|
Content |
Content of the article |
Text |
|
yes |
|
Time |
time |
Datetime |
|
yes |
news |
ID |
Message ID |
Int 10 |
ID |
no |
|
Uid |
Message Receiver ID |
Varchar 20 |
|
no |
|
Tid |
Application Team ID |
Int 10 |
|
yes |
|
Msg |
Message content |
Varchar 256 |
|
yes |
|
State |
Message status |
Int 10 |
|
yes |
|
Time |
Delivery time |
Datetime |
|
yes |
|
SUid |
Message sender ID |
Varchar 20 |
|
no |
plan |
ID |
Plan ID |
Int 10 |
ID |
no |
|
Tid |
Team ID |
Int 10 |
|
yes |
|
Title |
Title |
Varchar 100 |
|
no |
|
Content |
content |
Text |
|
yes |
|
Btime |
start time |
Datetime |
|
yes |
|
Etime |
Ending time |
Datetime |
|
yes |
|
State |
state |
Int 10 |
|
yes |
Next week, we plan to complete the registration of web-side logins.