#702: MySQL error in upgrader

This commit is contained in:
md_5
2017-08-16 20:52:28 +10:00
parent a51651c306
commit 40c1cc1c22

View File

@@ -388,17 +388,19 @@ class Updater {
if (configVersion.compareTo(new ComparableVersion("1.12.0")) < 0) {
getLogger().info("Updating tables to 1.12.0 ...");
if (isLogging(Logging.CHAT)) {
final Connection conn = logblock.getConnection();
try {
conn.setAutoCommit(true);
final Statement st = conn.createStatement();
st.execute("ALTER TABLE `lb-chat` ALTER COLUMN `message` VARCHAR(256) NOT NULL");
st.execute("ALTER TABLE `lb-chat` MODIFY COLUMN `message` VARCHAR(256) NOT NULL");
st.close();
conn.close();
} catch (final SQLException ex) {
Bukkit.getLogger().log(Level.SEVERE, "[Updater] Error: ", ex);
return false;
}
}
config.set("version", "1.12.0");
}