OSDN Git Service

mod: ログ機能を追加
[epgrec/epgrec.git] / upgrade_db.php
index 9fbb380..866b009 100755 (executable)
@@ -4,7 +4,8 @@ $script_path = dirname( __FILE__ );
 chdir( $script_path );
 include_once($script_path . '/config.php');
 include_once(INSTALL_PATH . '/Settings.class.php' );
-
+include_once(INSTALL_PATH . '/DBRecord.class.php' );
+include_once(INSTALL_PATH . '/tableStruct.inc.php' );
 
 // mysqli::multi_queryは動作がいまいちなので使わない
 
@@ -193,6 +194,18 @@ if( $dbh !== FALSE ) {
        if( multi_query( $sqlstrs, $dbh ) ) {
                echo "キーワードテーブルのアップデートに失敗\n";
        }
+
+       // ログテーブル
+
+       try {
+               $log = new DBRecord( LOG_TBL );
+               $log->createTable( LOG_STRUCT );
+       }
+       catch( Exception $e ) {
+               echo $e->message;
+               echo "\n";
+       }
+
 }
 else
        exit( "DBの接続に失敗\n" );