Skip to content

Commit

Permalink
change database engine to InnoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
popiazaza committed Aug 21, 2020
1 parent db71f11 commit 5b5d87c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion th_chat/discuz_plugin_th_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<item id="datatables"><![CDATA[]]></item>
<item id="directory"><![CDATA[th_chat/]]></item>
<item id="copyright"><![CDATA[newz]]></item>
<item id="version"><![CDATA[2.20b]]></item>
<item id="version"><![CDATA[2.21]]></item>
<item id="__modules">
<item id="0">
<item id="name"><![CDATA[chat]]></item>
Expand Down
4 changes: 2 additions & 2 deletions th_chat/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
`time` int(10) unsigned NOT NULL,
`ip` varchar(25) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;");
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
DB::query("DROP TABLE IF EXISTS `".DB::table('newz_nick')."`;");
DB::query("CREATE TABLE IF NOT EXISTS `".DB::table('newz_nick')."` (
`uid` mediumint(8) unsigned NOT NULL,
Expand All @@ -22,7 +22,7 @@
`sound_2` int(1) NOT NULL DEFAULT '1',
`ban` INT(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;");
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
DB::query("INSERT INTO `".DB::table('newz_data')."` (`uid`, `touid`, `icon`, `text`, `time`,`ip`) VALUES (1, 0, 'alert', 'ยินดีต้อนรับสู่ห้องแชท คุณสามารถเริ่มพิมพ์ข้อความของคุณได้ด้านล่างนี้~!', ".TIMESTAMP.", '".$_G['clientip']."');");
$finish = TRUE;
?>
4 changes: 3 additions & 1 deletion th_chat/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
runquery($sql);
}

if ($_GET['fromversion'] <= "2.20b") {
if ($_GET['fromversion'] <= "2.21") {
DB::query("ALTER TABLE `pre_newz_data` RENAME `".DB::table('newz_data')."`;");
DB::query("ALTER TABLE `pre_newz_nick` RENAME `".DB::table('newz_nick')."`;");
DB::query("ALTER TABLE `".DB::table('newz_data')."` ENGINE=InnoDB;");
DB::query("ALTER TABLE `".DB::table('newz_nick')."` ENGINE=InnoDB;");
}

$finish = TRUE;
Expand Down

0 comments on commit 5b5d87c

Please sign in to comment.