--- fenglin/TODO/sql/db_stru.sql	2004/06/20 06:59:41	1.1
+++ fenglin/TODO/sql/db_stru.sql	2005/09/27 15:08:12	1.2
@@ -10,10 +10,8 @@ CREATE TABLE `admin_config` (
   `enable` tinyint(1) unsigned NOT NULL default '1',
   `major` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`AID`),
-  KEY `UID` (`UID`),
-  KEY `enable` (`enable`),
-  KEY `major` (`major`)
-) TYPE=MyISAM; 
+  KEY `UID` (`UID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -24,9 +22,8 @@ CREATE TABLE `ban_ip_list` (
   `begin_ip` varchar(20) default NULL,
   `end_ip` varchar(20) default NULL,
   `enable` tinyint(1) unsigned NOT NULL default '1',
-  PRIMARY KEY  (`BID`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  PRIMARY KEY  (`BID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -46,11 +43,11 @@ CREATE TABLE `ban_user_list` (
   `enable` tinyint(1) unsigned NOT NULL default '1',
   `reason` text,
   PRIMARY KEY  (`BID`),
-  KEY `enable` (`enable`),
-  KEY `UID` (`UID`),
+  KEY `ban_UID` (`ban_UID`),
+  KEY `SID` (`SID`),
   KEY `day` (`day`),
-  KEY `SID` (`SID`)
-) TYPE=MyISAM; 
+  KEY `UID` (`UID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -61,6 +58,7 @@ CREATE TABLE `bbs` (
   `SID` smallint(6) NOT NULL default '0',
   `TID` mediumint(9) NOT NULL default '0',
   `UID` mediumint(9) NOT NULL default '0',
+  `username` varchar(20) default '',
   `nickname` varchar(20) default NULL,
   `title` varchar(80) default NULL,
   `CID` mediumint(9) NOT NULL default '0',
@@ -72,6 +70,7 @@ CREATE TABLE `bbs` (
   `exp` mediumint(9) NOT NULL default '0',
   `last_reply_dt` datetime default NULL,
   `last_reply_UID` mediumint(9) NOT NULL default '0',
+  `last_reply_username` varchar(20) default '',
   `last_reply_nickname` varchar(20) default NULL,
   `transship` tinyint(1) unsigned NOT NULL default '0',
   `lock` tinyint(1) unsigned NOT NULL default '0',
@@ -81,28 +80,26 @@ CREATE TABLE `bbs` (
   `excerption` tinyint(1) unsigned NOT NULL default '0',
   `ontop` tinyint(1) unsigned NOT NULL default '0',
   `static` tinyint(1) unsigned NOT NULL default '0',
+  `cached` tinyint(3) unsigned NOT NULL default '0',
   `recommend` tinyint(1) unsigned NOT NULL default '0',
+  `gen_ex` tinyint(1) unsigned NOT NULL default '0',
+  `m_del` tinyint(1) unsigned NOT NULL default '0',
   `old_SID` smallint(6) NOT NULL default '0',
   `old_TID` mediumint(9) NOT NULL default '0',
   PRIMARY KEY  (`AID`),
   UNIQUE KEY `CID` (`CID`),
-  KEY `last_reply_UID` (`last_reply_UID`),
-  KEY `recommend` (`recommend`),
-  KEY `SID` (`SID`),
-  KEY `visible` (`visible`),
-  KEY `TID` (`TID`),
-  KEY `last_reply_dt` (`last_reply_dt`),
-  KEY `ontop` (`ontop`),
-  KEY `sub_dt` (`sub_dt`),
+  KEY `UID` (`UID`),
   KEY `reply_count` (`reply_count`),
+  KEY `last_reply_dt` (`last_reply_dt`),
   KEY `view_count` (`view_count`),
-  KEY `UID` (`UID`),
+  KEY `sub_dt` (`sub_dt`),
+  KEY `title` (`title`(10)),
   KEY `old_SID` (`old_SID`),
-  KEY `transship` (`transship`),
+  KEY `SID` (`SID`),
   KEY `old_TID` (`old_TID`),
-  KEY `excerption` (`excerption`),
-  KEY `title` (`title`(10))
-) TYPE=MyISAM; 
+  KEY `TID` (`TID`),
+  KEY `last_reply_UID` (`last_reply_UID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -115,12 +112,12 @@ CREATE TABLE `bbs_article_op` (
   `type` char(1) NOT NULL default '',
   `op_dt` datetime default NULL,
   `op_ip` varchar(20) default NULL,
-  `complete` tinyint(1) unsigned NOT NULL default '0',
+  `complete` tinyint(1) unsigned NOT NULL default '1',
   PRIMARY KEY  (`MID`),
+  KEY `AID` (`AID`),
   KEY `UID` (`UID`),
-  KEY `type` (`type`),
-  KEY `AID` (`AID`)
-) TYPE=MyISAM; 
+  KEY `type` (`type`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -132,7 +129,7 @@ CREATE TABLE `bbs_content` (
   `content` longtext,
   PRIMARY KEY  (`CID`),
   KEY `AID` (`AID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -148,9 +145,8 @@ CREATE TABLE `bbs_ex_dl` (
   `enable` tinyint(1) unsigned NOT NULL default '1',
   PRIMARY KEY  (`ID`),
   UNIQUE KEY `SID` (`SID`),
-  KEY `dl_type` (`dl_type`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  KEY `dl_type` (`dl_type`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -168,11 +164,8 @@ CREATE TABLE `bbs_msg` (
   `s_deleted` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`MID`),
   KEY `fromUID` (`fromUID`),
-  KEY `toUID` (`toUID`),
-  KEY `new` (`new`),
-  KEY `deleted` (`deleted`),
-  KEY `s_deleted` (`s_deleted`)
-) TYPE=MyISAM; 
+  KEY `toUID` (`toUID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -185,10 +178,8 @@ CREATE TABLE `bbs_prize` (
   `score` mediumint(9) NOT NULL default '0',
   `enable` tinyint(1) unsigned NOT NULL default '1',
   `count_left` mediumint(9) NOT NULL default '0',
-  PRIMARY KEY  (`PID`),
-  KEY `score` (`score`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  PRIMARY KEY  (`PID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -206,7 +197,7 @@ CREATE TABLE `bbs_recommend` (
   KEY `UID` (`UID`),
   KEY `TID` (`TID`),
   KEY `type` (`type`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -216,7 +207,7 @@ CREATE TABLE `bbs_top_list` (
   `AID` mediumint(9) NOT NULL default '0',
   `bbs_title` varchar(80) NOT NULL default '',
   `section_title` varchar(20) NOT NULL default ''
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -234,10 +225,10 @@ CREATE TABLE `email` (
   `send_dt` datetime default NULL,
   `complete` tinyint(1) unsigned NOT NULL default '0',
   `error` tinyint(1) unsigned NOT NULL default '0',
+  `error_msg` varchar(255) default NULL,
   PRIMARY KEY  (`ID`),
-  KEY `complete` (`complete`),
-  KEY `error` (`error`)
-) TYPE=MyISAM; 
+  KEY `complete` (`complete`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -252,9 +243,8 @@ CREATE TABLE `ex_dir` (
   `dt` datetime default '0000-00-00 00:00:00',
   PRIMARY KEY  (`FID`),
   UNIQUE KEY `dir` (`dir`,`SID`),
-  KEY `SID` (`SID`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  KEY `SID` (`SID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -265,7 +255,7 @@ CREATE TABLE `ex_file` (
   `FID` smallint(6) NOT NULL default '0',
   PRIMARY KEY  (`AID`),
   KEY `FID` (`FID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -292,9 +282,8 @@ CREATE TABLE `exam_question_lib` (
   `E5` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`QID`),
   KEY `type` (`type`),
-  KEY `enable` (`enable`),
   KEY `class` (`class`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -320,13 +309,10 @@ CREATE TABLE `exam_user_list` (
   `user_comment` text,
   PRIMARY KEY  (`TID`),
   UNIQUE KEY `voucher` (`voucher`),
-  KEY `pass` (`pass`),
   KEY `class` (`class`),
   KEY `UID` (`UID`),
-  KEY `score` (`score`),
-  KEY `done` (`done`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  KEY `score` (`score`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -345,9 +331,8 @@ CREATE TABLE `exam_user_question` (
   `user_answer_text` text,
   PRIMARY KEY  (`ID`),
   KEY `QID` (`QID`),
-  KEY `TID` (`TID`),
-  KEY `done` (`done`)
-) TYPE=MyISAM; 
+  KEY `TID` (`TID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -360,7 +345,7 @@ CREATE TABLE `friend_list` (
   PRIMARY KEY  (`ID`),
   KEY `fUID` (`fUID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -380,11 +365,8 @@ CREATE TABLE `innd_access` (
   `enable` tinyint(1) unsigned NOT NULL default '1',
   PRIMARY KEY  (`ID`),
   KEY `server` (`server`),
-  KEY `use_post` (`use_post`),
-  KEY `enable` (`enable`),
-  KEY `use_ihave` (`use_ihave`),
   KEY `ip` (`ip`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -402,14 +384,10 @@ CREATE TABLE `innd_conf` (
   `cancel` tinyint(1) unsigned NOT NULL default '0',
   `passive_mode` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`ID`),
-  KEY `in` (`in`),
-  KEY `out` (`out`),
-  KEY `cancel` (`cancel`),
   KEY `SID` (`SID`),
   KEY `group` (`group`),
-  KEY `server` (`server`),
-  KEY `passive_mode` (`passive_mode`)
-) TYPE=MyISAM; 
+  KEY `server` (`server`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -422,10 +400,9 @@ CREATE TABLE `innd_log` (
   `op` enum('I','O') NOT NULL default 'I',
   `cancel` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`AID`),
-  KEY `cancel` (`cancel`),
   KEY `op` (`op`),
   KEY `msg_id` (`msg_id`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -442,56 +419,7 @@ CREATE TABLE `innd_todo` (
   KEY `AID` (`AID`),
   KEY `op` (`op`),
   KEY `server` (`server`)
-) TYPE=MyISAM; 
-
-# Host: localhost
-# Database: leafok
-# Table: 'innocentive'
-# 
-CREATE TABLE `innocentive` (
-  `ID` mediumint(9) NOT NULL auto_increment,
-  `UID` mediumint(9) NOT NULL default '0',
-  `username` varchar(20) NOT NULL default '',
-  `password` varchar(20) NOT NULL default '',
-  `firstname` varchar(10) NOT NULL default '',
-  `lastname` varchar(10) NOT NULL default '',
-  `email` varchar(50) NOT NULL default '',
-  `address` varchar(100) NOT NULL default '',
-  `city` varchar(15) NOT NULL default '',
-  `province` varchar(15) NOT NULL default '',
-  `country` varchar(15) NOT NULL default '',
-  `postcode` varchar(10) NOT NULL default '',
-  `company` varchar(100) NOT NULL default '',
-  `biochemistry` tinyint(1) NOT NULL default '0',
-  `bioengineering` tinyint(1) NOT NULL default '0',
-  `bioinfomatics` tinyint(1) NOT NULL default '0',
-  `biophysics` tinyint(1) NOT NULL default '0',
-  `cellular` tinyint(1) NOT NULL default '0',
-  `genetics` tinyint(1) NOT NULL default '0',
-  `genomics` tinyint(1) NOT NULL default '0',
-  `histopathology` tinyint(1) NOT NULL default '0',
-  `immunology` tinyint(1) NOT NULL default '0',
-  `microbiology` tinyint(1) NOT NULL default '0',
-  `pharmacology` tinyint(1) NOT NULL default '0',
-  `physiology` tinyint(1) NOT NULL default '0',
-  `proteomics` tinyint(1) NOT NULL default '0',
-  `structural` tinyint(1) NOT NULL default '0',
-  `toxicology` tinyint(1) NOT NULL default '0',
-  `environmental` tinyint(1) NOT NULL default '0',
-  `kinase` tinyint(1) NOT NULL default '0',
-  `virology` tinyint(1) NOT NULL default '0',
-  `metabolic` tinyint(1) NOT NULL default '0',
-  `molecular` tinyint(1) NOT NULL default '0',
-  `protein` tinyint(1) NOT NULL default '0',
-  `receive_email` tinyint(1) NOT NULL default '0',
-  `html_email` tinyint(1) NOT NULL default '0',
-  `verified` tinyint(1) NOT NULL default '0',
-  `gift_given` tinyint(1) NOT NULL default '0',
-  PRIMARY KEY  (`ID`),
-  UNIQUE KEY `UID` (`UID`),
-  KEY `verified` (`verified`),
-  KEY `gift_given` (`gift_given`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -505,7 +433,7 @@ CREATE TABLE `ip_list` (
   `area` varchar(20) NOT NULL default '',
   PRIMARY KEY  (`IPID`),
   KEY `ip` (`begin_ip`,`end_ip`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -527,7 +455,7 @@ CREATE TABLE `jk_log` (
   KEY `UID` (`UID`),
   KEY `amount` (`amount`),
   KEY `process` (`process`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -541,7 +469,7 @@ CREATE TABLE `journal_data` (
   PRIMARY KEY  (`ID`),
   UNIQUE KEY `AID` (`AID`),
   KEY `JID` (`JID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -551,9 +479,8 @@ CREATE TABLE `journal_index` (
   `JID` smallint(6) NOT NULL auto_increment,
   `dt` datetime NOT NULL default '0000-00-00 00:00:00',
   `enable` tinyint(1) NOT NULL default '0',
-  PRIMARY KEY  (`JID`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  PRIMARY KEY  (`JID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -566,7 +493,7 @@ CREATE TABLE `mng_err_login_log` (
   `login_dt` datetime default NULL,
   `login_ip` varchar(20) default NULL,
   PRIMARY KEY  (`ID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -580,7 +507,7 @@ CREATE TABLE `mng_login_log` (
   PRIMARY KEY  (`ID`),
   KEY `UID` (`UID`),
   KEY `login_dt` (`login_dt`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -606,7 +533,7 @@ CREATE TABLE `mng_priv_list` (
   `article_recommend` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`PID`),
   UNIQUE KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -618,9 +545,8 @@ CREATE TABLE `mng_user_list` (
   `password` varchar(32) NOT NULL default '',
   `enable` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`UID`),
-  UNIQUE KEY `username` (`username`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  UNIQUE KEY `username` (`username`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -635,7 +561,7 @@ CREATE TABLE `page_log` (
   `script` varchar(255) NOT NULL default '',
   `query` varchar(255) default '',
   PRIMARY KEY  (`ID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -650,7 +576,7 @@ CREATE TABLE `page_log_bak` (
   `script` varchar(255) NOT NULL default '',
   `query` varchar(255) default '',
   PRIMARY KEY  (`ID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -663,7 +589,7 @@ CREATE TABLE `page_log_stat` (
   `hour` smallint(4) NOT NULL default '0',
   `c_page` smallint(6) NOT NULL default '0',
   KEY `dt` (`year`,`month`,`day`,`hour`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -682,10 +608,9 @@ CREATE TABLE `s_e` (
   `email` varchar(30) NOT NULL default '',
   `ip` varchar(20) NOT NULL default '',
   PRIMARY KEY  (`ID`),
-  KEY `enable` (`enable`),
   KEY `location` (`location`),
   KEY `class` (`class`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -698,7 +623,7 @@ CREATE TABLE `section_apply_log` (
   `process_dt` datetime default NULL,
   `memo` tinytext,
   PRIMARY KEY  (`AID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -711,9 +636,8 @@ CREATE TABLE `section_class` (
   `enable` tinyint(1) unsigned NOT NULL default '1',
   `sort_order` smallint(6) NOT NULL default '10',
   PRIMARY KEY  (`CID`),
-  KEY `enable` (`enable`),
   KEY `sort_order` (`sort_order`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -729,11 +653,9 @@ CREATE TABLE `section_class_master` (
   `memo` tinytext,
   `major` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`MID`),
-  KEY `enable` (`enable`),
   KEY `UID` (`UID`),
-  KEY `major` (`major`),
   KEY `CID` (`CID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -746,10 +668,9 @@ CREATE TABLE `section_config` (
   `title` varchar(20) default NULL,
   `comment` varchar(255) default NULL,
   `topic_max_count` smallint(6) NOT NULL default '0',
-  `announcement` varchar(255) default NULL,
+  `announcement` text,
   `bgsound` smallint(6) NOT NULL default '0',
   `enable` tinyint(1) unsigned NOT NULL default '1',
-  `public` tinyint(1) unsigned NOT NULL default '1',
   `exp_get` tinyint(1) unsigned NOT NULL default '0',
   `recommend` tinyint(1) unsigned NOT NULL default '0',
   `transship_ratio` float NOT NULL default '0.5',
@@ -760,16 +681,15 @@ CREATE TABLE `section_config` (
   `ex_gen_tm` datetime default '0000-00-00 00:00:00',
   `ex_pack_tm` datetime default '0000-00-00 00:00:00',
   `ex_update` tinyint(1) unsigned NOT NULL default '0',
-  `access_user_level` smallint(6) NOT NULL default '0',
+  `read_user_level` smallint(6) NOT NULL default '0',
+  `write_user_level` smallint(6) NOT NULL default '0',
   PRIMARY KEY  (`SID`),
-  KEY `sort_order` (`sort_order`),
-  KEY `public` (`public`),
   KEY `CID` (`CID`),
-  KEY `recommend` (`recommend`),
-  KEY `exp_get` (`exp_get`),
-  KEY `sname` (`sname`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  KEY `write_user_level` (`write_user_level`),
+  KEY `sort_order` (`sort_order`),
+  KEY `read_user_level` (`read_user_level`),
+  KEY `sname` (`sname`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -781,7 +701,7 @@ CREATE TABLE `section_favorite` (
   `SID` smallint(6) NOT NULL default '0',
   PRIMARY KEY  (`ID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -799,10 +719,8 @@ CREATE TABLE `section_master` (
   `memo` tinytext,
   PRIMARY KEY  (`MID`),
   KEY `SID` (`SID`),
-  KEY `UID` (`UID`),
-  KEY `enable` (`enable`),
-  KEY `major` (`major`)
-) TYPE=MyISAM; 
+  KEY `UID` (`UID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -819,7 +737,20 @@ CREATE TABLE `section_master_apply` (
   `major` tinyint(1) unsigned NOT NULL default '0',
   `memo` tinytext,
   PRIMARY KEY  (`AID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
+
+# Host: localhost
+# Database: leafok
+# Table: 'section_user_priv'
+# 
+CREATE TABLE `section_user_priv` (
+  `SID` smallint(6) NOT NULL default '0',
+  `UID` mediumint(9) NOT NULL default '0',
+  `read` tinyint(1) unsigned NOT NULL default '0',
+  `write` tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (`SID`,`UID`),
+  KEY `UID` (`UID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -832,7 +763,7 @@ CREATE TABLE `send_pass_log` (
   `ip` varchar(20) NOT NULL default '',
   PRIMARY KEY  (`ID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -850,9 +781,8 @@ CREATE TABLE `upload_file` (
   PRIMARY KEY  (`AID`),
   KEY `check` (`check`),
   KEY `UID` (`UID`),
-  KEY `deny` (`deny`),
   KEY `ref_AID` (`ref_AID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -872,10 +802,9 @@ CREATE TABLE `user_auth` (
   `auth_type` enum('PID','EMAIL','TRUST','SCORE') NOT NULL default 'TRUST',
   PRIMARY KEY  (`AUID`),
   KEY `UID` (`UID`),
-  KEY `enable` (`enable`),
   KEY `expire_dt` (`expire_dt`),
   KEY `auth_type` (`auth_type`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -888,12 +817,8 @@ CREATE TABLE `user_elect` (
   `invalid` tinyint(1) unsigned NOT NULL default '0',
   `voted` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`ID`),
-  KEY `invalid` (`invalid`),
-  KEY `UID` (`UID`),
-  KEY `attend` (`attend`),
-  KEY `invalid_2` (`invalid`),
-  KEY `voted` (`voted`)
-) TYPE=MyISAM; 
+  KEY `UID` (`UID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -904,7 +829,7 @@ CREATE TABLE `user_elect_vote` (
   `vote_UID` mediumint(9) NOT NULL default '0',
   KEY `elect_UID` (`elect_UID`),
   KEY `vote_UID` (`vote_UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -917,7 +842,7 @@ CREATE TABLE `user_err_login_log` (
   `login_dt` datetime default NULL,
   `login_ip` varchar(20) default NULL,
   PRIMARY KEY  (`ID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -933,7 +858,7 @@ CREATE TABLE `user_life_log` (
   PRIMARY KEY  (`ID`),
   KEY `set_UID` (`set_UID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -941,7 +866,7 @@ CREATE TABLE `user_life_log` (
 # 
 CREATE TABLE `user_list` (
   `UID` mediumint(9) NOT NULL auto_increment,
-  `username` varchar(14) NOT NULL default '',
+  `username` varchar(20) NOT NULL default '',
   `password` varchar(32) NOT NULL default '',
   `enable` tinyint(1) unsigned NOT NULL default '1',
   `verified` tinyint(1) unsigned NOT NULL default '0',
@@ -953,7 +878,7 @@ CREATE TABLE `user_list` (
   UNIQUE KEY `username` (`username`),
   KEY `verified` (`verified`),
   KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -967,7 +892,7 @@ CREATE TABLE `user_login_log` (
   PRIMARY KEY  (`ID`),
   KEY `UID` (`UID`),
   KEY `login_dt` (`login_dt`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -985,7 +910,7 @@ CREATE TABLE `user_modify_email_verify`
   UNIQUE KEY `verify_code` (`verify_code`),
   KEY `UID` (`UID`),
   KEY `complete` (`complete`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -999,7 +924,7 @@ CREATE TABLE `user_modify_log` (
   `complete` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`MID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1018,14 +943,14 @@ CREATE TABLE `user_nickname` (
   KEY `nickname` (`nickname`),
   KEY `begin_dt` (`begin_dt`),
   KEY `end_dt` (`end_dt`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
 # Table: 'user_online'
 # 
 CREATE TABLE `user_online` (
-  `ID` mediumint(9) NOT NULL auto_increment,
+  `ID` int(9) NOT NULL auto_increment,
   `SID` varchar(32) NOT NULL default '',
   `UID` mediumint(9) NOT NULL default '0',
   `ip` varchar(20) NOT NULL default '',
@@ -1038,7 +963,7 @@ CREATE TABLE `user_online` (
   KEY `UID` (`UID`),
   KEY `last_tm` (`last_tm`),
   KEY `SID` (`SID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1055,9 +980,8 @@ CREATE TABLE `user_prize` (
   PRIMARY KEY  (`ID`),
   KEY `UID` (`UID`),
   KEY `PID` (`PID`),
-  KEY `process` (`process`),
-  KEY `complete` (`complete`)
-) TYPE=MyISAM; 
+  KEY `process` (`process`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1097,7 +1021,7 @@ CREATE TABLE `user_pubinfo` (
   KEY `exp` (`exp`),
   KEY `last_login_dt` (`last_login_dt`),
   KEY `subscribe_jid` (`subscribe_jid`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1106,7 +1030,7 @@ CREATE TABLE `user_pubinfo` (
 CREATE TABLE `user_reginfo` (
   `UID` mediumint(9) NOT NULL default '0',
   `name` varchar(10) default NULL,
-  `birthday` date default NULL,
+  `birthday` datetime default NULL,
   `address` varchar(80) default NULL,
   `tel` varchar(20) default NULL,
   `postcode` varchar(6) default NULL,
@@ -1118,7 +1042,7 @@ CREATE TABLE `user_reginfo` (
   `signup_ip` varchar(20) default NULL,
   `memo` text,
   PRIMARY KEY  (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1138,7 +1062,7 @@ CREATE TABLE `user_reginfo_log` (
   `city` varchar(10) default NULL,
   PRIMARY KEY  (`ID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1150,9 +1074,8 @@ CREATE TABLE `user_regverify` (
   `complete` tinyint(1) unsigned NOT NULL default '0',
   `set_dt` datetime default NULL,
   PRIMARY KEY  (`UID`),
-  UNIQUE KEY `verify_code` (`verify_code`),
-  KEY `complete` (`complete`)
-) TYPE=MyISAM; 
+  UNIQUE KEY `verify_code` (`verify_code`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1166,9 +1089,8 @@ CREATE TABLE `user_relation` (
   `last_exp` mediumint(9) NOT NULL default '0',
   PRIMARY KEY  (`RID`),
   UNIQUE KEY `cUID` (`cUID`),
-  KEY `pUID` (`pUID`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+  KEY `pUID` (`pUID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1181,7 +1103,7 @@ CREATE TABLE `user_score` (
   `exp_left` mediumint(9) NOT NULL default '0',
   PRIMARY KEY  (`UID`),
   KEY `score` (`score`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1195,7 +1117,7 @@ CREATE TABLE `user_score_log` (
   `dt` datetime default NULL,
   PRIMARY KEY  (`ID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1208,7 +1130,7 @@ CREATE TABLE `user_switch_list` (
   PRIMARY KEY  (`ID`),
   KEY `tUID` (`tUID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1221,7 +1143,19 @@ CREATE TABLE `user_trust_log` (
   PRIMARY KEY  (`ID`),
   KEY `tUID` (`tUID`),
   KEY `UID` (`UID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
+
+# Host: localhost
+# Database: leafok
+# Table: 'view_article_log'
+# 
+CREATE TABLE `view_article_log` (
+  `AID` mediumint(11) NOT NULL default '0',
+  `UID` mediumint(9) NOT NULL default '0',
+  `dt` datetime NOT NULL default '0000-00-00 00:00:00',
+  PRIMARY KEY  (`AID`,`UID`),
+  KEY `dt` (`dt`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1232,25 +1166,7 @@ CREATE TABLE `visit_log` (
   `dt` datetime default NULL,
   `ip` varchar(20) default NULL,
   PRIMARY KEY  (`VID`)
-) TYPE=MyISAM; 
-
-# Host: localhost
-# Database: leafok
-# Table: 'vmail'
-# 
-CREATE TABLE `vmail` (
-  `ID` smallint(6) NOT NULL auto_increment,
-  `UID` mediumint(9) NOT NULL default '0',
-  `name` varchar(10) default NULL,
-  `username` varchar(20) NOT NULL default '',
-  `enable` tinyint(1) unsigned NOT NULL default '0',
-  `begin_dt` datetime NOT NULL default '0000-00-00 00:00:00',
-  `end_dt` datetime NOT NULL default '0000-00-00 00:00:00',
-  `memo` text NOT NULL,
-  PRIMARY KEY  (`ID`),
-  KEY `username` (`username`),
-  KEY `enable` (`enable`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1263,7 +1179,7 @@ CREATE TABLE `vote_answer` (
   `count` smallint(6) NOT NULL default '0',
   PRIMARY KEY  (`AID`),
   KEY `VID` (`VID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1277,10 +1193,9 @@ CREATE TABLE `vote_config` (
   `end_dt` datetime default NULL,
   `enable` tinyint(1) unsigned NOT NULL default '1',
   PRIMARY KEY  (`VID`),
-  KEY `enable` (`enable`),
   KEY `begin_dt` (`begin_dt`),
   KEY `end_dt` (`end_dt`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
 # Host: localhost
 # Database: leafok
@@ -1297,5 +1212,5 @@ CREATE TABLE `vote_log` (
   KEY `UID` (`UID`),
   KEY `VID` (`VID`),
   KEY `AID` (`AID`)
-) TYPE=MyISAM; 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1; 
 
