--- fenglin/TODO/sql/db_stru.sql	2025/03/08 02:58:02	1.5
+++ fenglin/TODO/sql/db_stru.sql	2025/03/28 12:04:46	1.8
@@ -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,7 +217,7 @@ 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',
@@ -252,7 +229,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'
@@ -391,26 +367,14 @@ 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,
@@ -494,18 +458,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 +470,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 +493,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 +516,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`);
@@ -702,17 +648,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`),
@@ -742,16 +681,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 +688,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 +710,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;
 
@@ -864,23 +788,12 @@ 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;
