forked from LogBlock/LogBlock
#702: MySQL error in upgrader
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user