diff --git a/twe/install_ok.php b/twe/install_ok.php index fa2d7615..d14a0f2a 100644 --- a/twe/install_ok.php +++ b/twe/install_ok.php @@ -49,6 +49,8 @@ if(isTable($connect, "auction", $dbname)) @MYDB_query("drop table auction", $con if(isTable($connect, "statistic",$dbname)) @MYDB_query("drop table statistic", $connect) or Error("drop ".MYDB_error($connect),""); // 연감 테이블 삭제 if(isTable($connect, "history",$dbname)) @MYDB_query("drop table history", $connect) or Error("drop ".MYDB_error($connect),""); +// 메시지 테이블 삭제 +if(isTable($connect, "message",$dbname)) @MYDB_query("drop table message", $connect) or Error("drop ".MYDB_error($connect),""); // 관리자 테이블 생성 if(!isTable($connect, "game", $dbname)) @MYDB_query($game_schema, $connect) or Error("create game ".MYDB_error($connect),""); @@ -75,6 +77,10 @@ if(!isTable($connect, "hall", $dbname)) { } } } +// 메시지 테이블 생성 +if(!isTable($connect, "message", $dbname)) { + MYDB_query($message_schema, $connect) or Error("create message ".MYDB_error($connect),""); +} // 왕조 테이블 생성 if(!isTable($connect, "emperior",$dbname)) @MYDB_query($emperior_schema, $connect) or Error("create emperior ".MYDB_error($connect),""); diff --git a/twe/schema.php b/twe/schema.php index 96f018c7..c20dba4e 100644 --- a/twe/schema.php +++ b/twe/schema.php @@ -426,6 +426,29 @@ $game_schema = " "; +/////////////////////////////////////////////////////////////////////////// +// 메시지 테이블 +/////////////////////////////////////////////////////////////////////////// +$message_schema = " +CREATE TABLE `message` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `address` INT(11) NOT NULL, + `type` ENUM('send','receive') NOT NULL, + `src` INT(11) NOT NULL, + `dest` INT(11) NOT NULL, + `time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `message` TEXT NOT NULL, + PRIMARY KEY (`id`), + INDEX `by_owner` (`address`, `time`), + INDEX `by_dest` (`dest`, `time`), + INDEX `by_full` (`src`, `dest`, `time`) +) +COLLATE='utf8_general_ci' +ENGINE=InnoDB +; + +"; + /////////////////////////////////////////////////////////////////////////// // 명전 테이블 ///////////////////////////////////////////////////////////////////////////