--- fenglin/TODO/sql/db_stru.sql	2025/03/08 02:58:02	1.5
+++ fenglin/TODO/sql/db_stru.sql	2025/03/31 14:18:20	1.9
@@ -1,4 +1,5 @@
 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+START TRANSACTION;
 SET time_zone = "+00:00";
 
 CREATE TABLE `admin_config` (
@@ -10,13 +11,6 @@ CREATE TABLE `admin_config` (
   `major` tinyint UNSIGNED NOT NULL DEFAULT '0'
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
-CREATE TABLE `ban_ip_list` (
-  `BID` smallint NOT NULL,
-  `begin_ip` varchar(20) DEFAULT NULL,
-  `end_ip` varchar(20) DEFAULT NULL,
-  `enable` tinyint UNSIGNED NOT NULL DEFAULT '1'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
 CREATE TABLE `ban_user_list` (
   `BID` smallint NOT NULL,
   `SID` smallint NOT NULL DEFAULT '0',
@@ -59,12 +53,10 @@ CREATE TABLE `bbs` (
   `excerption` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `ontop` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `static` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `cached` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `recommend` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `gen_ex` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `m_del` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `old_SID` smallint NOT NULL DEFAULT '0',
-  `old_TID` mediumint NOT NULL DEFAULT '0'
+  `old_SID` smallint NOT NULL DEFAULT '0'
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
 CREATE TABLE `bbs_article_op` (
@@ -105,21 +97,6 @@ CREATE TABLE `bbs_msg` (
   `s_deleted` tinyint UNSIGNED NOT NULL DEFAULT '0'
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
-CREATE TABLE `bbs_prize` (
-  `PID` smallint NOT NULL,
-  `title` varchar(50) DEFAULT NULL,
-  `description` varchar(50) DEFAULT NULL,
-  `score` mediumint NOT NULL DEFAULT '0',
-  `enable` tinyint UNSIGNED NOT NULL DEFAULT '1',
-  `count_left` mediumint NOT NULL DEFAULT '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
-CREATE TABLE `bbs_top_list` (
-  `AID` int NOT NULL DEFAULT '0',
-  `bbs_title` varchar(80) NOT NULL DEFAULT '',
-  `section_title` varchar(20) NOT NULL DEFAULT ''
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
 CREATE TABLE `email` (
   `ID` int NOT NULL,
   `fromemail` varchar(30) DEFAULT NULL,
@@ -240,9 +217,8 @@ CREATE TABLE `section_config` (
   `CID` smallint NOT NULL DEFAULT '0',
   `title` varchar(20) DEFAULT NULL,
   `comment` varchar(255) DEFAULT NULL,
-  `topic_max_count` smallint NOT NULL DEFAULT '0',
+  `topic_retention` smallint NOT NULL DEFAULT '0',
   `announcement` longtext,
-  `bgsound` smallint NOT NULL DEFAULT '0',
   `enable` tinyint UNSIGNED NOT NULL DEFAULT '1',
   `exp_get` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `recommend` tinyint UNSIGNED NOT NULL DEFAULT '0',
@@ -252,7 +228,6 @@ CREATE TABLE `section_config` (
   `set_ip` varchar(20) DEFAULT NULL,
   `sort_order` smallint NOT NULL DEFAULT '10',
   `ex_gen_tm` datetime DEFAULT NULL,
-  `ex_pack_tm` datetime DEFAULT NULL,
   `ex_update` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `read_user_level` smallint NOT NULL DEFAULT '0',
   `write_user_level` smallint NOT NULL DEFAULT '0'
@@ -313,20 +288,6 @@ CREATE TABLE `upload_file` (
   `deleted` tinyint UNSIGNED NOT NULL DEFAULT '0'
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
-CREATE TABLE `user_auth` (
-  `AUID` mediumint NOT NULL,
-  `UID` mediumint NOT NULL DEFAULT '0',
-  `pid` varchar(18) DEFAULT NULL,
-  `name` varchar(10) DEFAULT NULL,
-  `email` varchar(30) DEFAULT NULL,
-  `expire_dt` datetime DEFAULT NULL,
-  `photo_enable` tinyint UNSIGNED NOT NULL DEFAULT '1',
-  `photo_ext` varchar(5) NOT NULL DEFAULT '',
-  `enable` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `process` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `auth_type` enum('PID','EMAIL','TRUST','SCORE') NOT NULL DEFAULT 'TRUST'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
 CREATE TABLE `user_err_login_log` (
   `ID` int NOT NULL,
   `username` varchar(14) DEFAULT NULL,
@@ -391,34 +352,20 @@ CREATE TABLE `user_nickname` (
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
 CREATE TABLE `user_online` (
-  `ID` int NOT NULL,
   `SID` varchar(32) NOT NULL DEFAULT '',
   `UID` mediumint NOT NULL DEFAULT '0',
   `ip` varchar(20) NOT NULL DEFAULT '',
-  `current_SID` smallint NOT NULL DEFAULT '0',
   `current_action` varchar(20) NOT NULL DEFAULT '',
   `login_tm` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `last_tm` datetime DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
-CREATE TABLE `user_prize` (
-  `ID` mediumint NOT NULL,
-  `UID` mediumint NOT NULL DEFAULT '0',
-  `PID` smallint NOT NULL DEFAULT '0',
-  `dt` datetime DEFAULT NULL,
-  `ip` varchar(20) DEFAULT NULL,
-  `process` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `complete` tinyint UNSIGNED NOT NULL DEFAULT '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
 CREATE TABLE `user_pubinfo` (
   `UID` mediumint NOT NULL DEFAULT '0',
   `nickname` varchar(20) DEFAULT NULL,
   `email` varchar(30) DEFAULT NULL,
   `gender` char(1) NOT NULL DEFAULT 'M',
   `qq` varchar(10) DEFAULT NULL,
-  `msn` varchar(30) DEFAULT NULL,
-  `homepage` varchar(80) DEFAULT NULL,
   `introduction` mediumtext,
   `photo` smallint DEFAULT '0',
   `photo_enable` tinyint(1) NOT NULL DEFAULT '0',
@@ -426,10 +373,6 @@ CREATE TABLE `user_pubinfo` (
   `life` smallint NOT NULL DEFAULT '15',
   `exp` mediumint DEFAULT '0',
   `visit_count` mediumint NOT NULL DEFAULT '0',
-  `email_pub` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `qq_pub` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `msn_pub` tinyint UNSIGNED NOT NULL DEFAULT '0',
-  `homepage_pub` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `gender_pub` tinyint UNSIGNED NOT NULL DEFAULT '0',
   `last_login_dt` datetime DEFAULT NULL,
   `sign_1` mediumtext,
@@ -438,40 +381,17 @@ CREATE TABLE `user_pubinfo` (
   `sub_permission` tinyint UNSIGNED NOT NULL DEFAULT '1',
   `upload_limit` int NOT NULL DEFAULT '1048576',
   `login_notify_dt` datetime DEFAULT NULL,
-  `subscribe_jid` smallint NOT NULL DEFAULT '-1',
-  `bgsound` tinyint(1) NOT NULL DEFAULT '1'
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
 CREATE TABLE `user_reginfo` (
   `UID` mediumint NOT NULL DEFAULT '0',
   `name` varchar(10) DEFAULT NULL,
   `birthday` datetime DEFAULT NULL,
-  `address` varchar(80) DEFAULT NULL,
-  `tel` varchar(20) DEFAULT NULL,
-  `postcode` varchar(6) DEFAULT NULL,
-  `pid` varchar(18) DEFAULT NULL,
-  `country` varchar(10) DEFAULT NULL,
-  `province` varchar(10) DEFAULT NULL,
-  `city` varchar(10) DEFAULT NULL,
   `signup_dt` datetime DEFAULT NULL,
   `signup_ip` varchar(20) DEFAULT NULL,
   `memo` mediumtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
-CREATE TABLE `user_reginfo_log` (
-  `ID` mediumint NOT NULL,
-  `UID` mediumint NOT NULL DEFAULT '0',
-  `name` varchar(10) DEFAULT NULL,
-  `birthday` date DEFAULT NULL,
-  `address` varchar(80) DEFAULT NULL,
-  `tel` varchar(20) DEFAULT NULL,
-  `postcode` varchar(6) DEFAULT NULL,
-  `pid` varchar(18) DEFAULT NULL,
-  `country` varchar(10) DEFAULT NULL,
-  `province` varchar(10) DEFAULT NULL,
-  `city` varchar(10) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
 CREATE TABLE `user_regverify` (
   `UID` mediumint NOT NULL DEFAULT '0',
   `verify_code` varchar(10) NOT NULL DEFAULT '',
@@ -494,18 +414,6 @@ CREATE TABLE `user_score_log` (
   `dt` datetime DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
-CREATE TABLE `user_switch_list` (
-  `ID` mediumint NOT NULL,
-  `UID` mediumint NOT NULL DEFAULT '0',
-  `tUID` mediumint NOT NULL DEFAULT '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
-CREATE TABLE `user_trust_log` (
-  `ID` mediumint NOT NULL,
-  `UID` mediumint NOT NULL DEFAULT '0',
-  `tUID` mediumint NOT NULL DEFAULT '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-
 CREATE TABLE `view_article_log` (
   `AID` int NOT NULL DEFAULT '0',
   `UID` mediumint NOT NULL DEFAULT '0',
@@ -518,13 +426,11 @@ CREATE TABLE `visit_log` (
   `ip` varchar(20) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
+
 ALTER TABLE `admin_config`
   ADD PRIMARY KEY (`AID`),
   ADD KEY `UID` (`UID`);
 
-ALTER TABLE `ban_ip_list`
-  ADD PRIMARY KEY (`BID`);
-
 ALTER TABLE `ban_user_list`
   ADD PRIMARY KEY (`BID`),
   ADD KEY `ban_UID` (`ban_UID`),
@@ -543,7 +449,6 @@ ALTER TABLE `bbs`
   ADD KEY `title` (`title`(10)),
   ADD KEY `old_SID` (`old_SID`),
   ADD KEY `SID` (`SID`),
-  ADD KEY `old_TID` (`old_TID`),
   ADD KEY `TID` (`TID`),
   ADD KEY `last_reply_UID` (`last_reply_UID`);
 
@@ -567,9 +472,6 @@ ALTER TABLE `bbs_msg`
   ADD KEY `fromUID` (`fromUID`),
   ADD KEY `toUID` (`toUID`);
 
-ALTER TABLE `bbs_prize`
-  ADD PRIMARY KEY (`PID`);
-
 ALTER TABLE `email`
   ADD PRIMARY KEY (`ID`),
   ADD KEY `complete` (`complete`);
@@ -658,12 +560,6 @@ ALTER TABLE `upload_file`
   ADD KEY `UID` (`UID`),
   ADD KEY `ref_AID` (`ref_AID`);
 
-ALTER TABLE `user_auth`
-  ADD PRIMARY KEY (`AUID`),
-  ADD KEY `UID` (`UID`),
-  ADD KEY `expire_dt` (`expire_dt`),
-  ADD KEY `auth_type` (`auth_type`);
-
 ALTER TABLE `user_err_login_log`
   ADD PRIMARY KEY (`ID`),
   ADD KEY `login_dt` (`login_dt`,`login_ip`);
@@ -702,17 +598,10 @@ ALTER TABLE `user_nickname`
   ADD KEY `end_dt` (`end_dt`);
 
 ALTER TABLE `user_online`
-  ADD PRIMARY KEY (`ID`),
+  ADD PRIMARY KEY (`SID`) USING BTREE,
   ADD KEY `login_tm` (`login_tm`),
   ADD KEY `UID` (`UID`),
-  ADD KEY `last_tm` (`last_tm`),
-  ADD KEY `SID` (`SID`);
-
-ALTER TABLE `user_prize`
-  ADD PRIMARY KEY (`ID`),
-  ADD KEY `UID` (`UID`),
-  ADD KEY `PID` (`PID`),
-  ADD KEY `process` (`process`);
+  ADD KEY `last_tm` (`last_tm`);
 
 ALTER TABLE `user_pubinfo`
   ADD PRIMARY KEY (`UID`),
@@ -721,15 +610,10 @@ ALTER TABLE `user_pubinfo`
   ADD KEY `login_notify_dt` (`login_notify_dt`),
   ADD KEY `exp` (`exp`),
   ADD KEY `last_login_dt` (`last_login_dt`),
-  ADD KEY `subscribe_jid` (`subscribe_jid`);
 
 ALTER TABLE `user_reginfo`
   ADD PRIMARY KEY (`UID`);
 
-ALTER TABLE `user_reginfo_log`
-  ADD PRIMARY KEY (`ID`),
-  ADD KEY `UID` (`UID`);
-
 ALTER TABLE `user_regverify`
   ADD PRIMARY KEY (`UID`),
   ADD UNIQUE KEY `verify_code` (`verify_code`);
@@ -742,16 +626,6 @@ ALTER TABLE `user_score_log`
   ADD PRIMARY KEY (`ID`),
   ADD KEY `UID` (`UID`);
 
-ALTER TABLE `user_switch_list`
-  ADD PRIMARY KEY (`ID`),
-  ADD KEY `tUID` (`tUID`),
-  ADD KEY `UID` (`UID`);
-
-ALTER TABLE `user_trust_log`
-  ADD PRIMARY KEY (`ID`),
-  ADD KEY `tUID` (`tUID`),
-  ADD KEY `UID` (`UID`);
-
 ALTER TABLE `view_article_log`
   ADD PRIMARY KEY (`AID`,`UID`),
   ADD KEY `dt` (`dt`);
@@ -759,12 +633,10 @@ ALTER TABLE `view_article_log`
 ALTER TABLE `visit_log`
   ADD PRIMARY KEY (`VID`);
 
+
 ALTER TABLE `admin_config`
   MODIFY `AID` smallint NOT NULL AUTO_INCREMENT;
 
-ALTER TABLE `ban_ip_list`
-  MODIFY `BID` smallint NOT NULL AUTO_INCREMENT;
-
 ALTER TABLE `ban_user_list`
   MODIFY `BID` smallint NOT NULL AUTO_INCREMENT;
 
@@ -783,9 +655,6 @@ ALTER TABLE `bbs_ex_dl`
 ALTER TABLE `bbs_msg`
   MODIFY `MID` int NOT NULL AUTO_INCREMENT;
 
-ALTER TABLE `bbs_prize`
-  MODIFY `PID` smallint NOT NULL AUTO_INCREMENT;
-
 ALTER TABLE `email`
   MODIFY `ID` int NOT NULL AUTO_INCREMENT;
 
@@ -840,9 +709,6 @@ ALTER TABLE `send_pass_log`
 ALTER TABLE `upload_file`
   MODIFY `AID` mediumint NOT NULL AUTO_INCREMENT;
 
-ALTER TABLE `user_auth`
-  MODIFY `AUID` mediumint NOT NULL AUTO_INCREMENT;
-
 ALTER TABLE `user_err_login_log`
   MODIFY `ID` int NOT NULL AUTO_INCREMENT;
 
@@ -864,23 +730,9 @@ ALTER TABLE `user_modify_log`
 ALTER TABLE `user_nickname`
   MODIFY `NID` mediumint NOT NULL AUTO_INCREMENT;
 
-ALTER TABLE `user_online`
-  MODIFY `ID` int NOT NULL AUTO_INCREMENT;
-
-ALTER TABLE `user_prize`
-  MODIFY `ID` mediumint NOT NULL AUTO_INCREMENT;
-
-ALTER TABLE `user_reginfo_log`
-  MODIFY `ID` mediumint NOT NULL AUTO_INCREMENT;
-
 ALTER TABLE `user_score_log`
   MODIFY `ID` mediumint NOT NULL AUTO_INCREMENT;
 
-ALTER TABLE `user_switch_list`
-  MODIFY `ID` mediumint NOT NULL AUTO_INCREMENT;
-
-ALTER TABLE `user_trust_log`
-  MODIFY `ID` mediumint NOT NULL AUTO_INCREMENT;
-
 ALTER TABLE `visit_log`
   MODIFY `VID` int NOT NULL AUTO_INCREMENT;
+COMMIT;
