forked from LogBlock/LogBlock
#702: MySQL error in upgrader
This commit is contained in:
@@ -388,16 +388,18 @@ class Updater {
|
|||||||
|
|
||||||
if (configVersion.compareTo(new ComparableVersion("1.12.0")) < 0) {
|
if (configVersion.compareTo(new ComparableVersion("1.12.0")) < 0) {
|
||||||
getLogger().info("Updating tables to 1.12.0 ...");
|
getLogger().info("Updating tables to 1.12.0 ...");
|
||||||
final Connection conn = logblock.getConnection();
|
if (isLogging(Logging.CHAT)) {
|
||||||
try {
|
final Connection conn = logblock.getConnection();
|
||||||
conn.setAutoCommit(true);
|
try {
|
||||||
final Statement st = conn.createStatement();
|
conn.setAutoCommit(true);
|
||||||
st.execute("ALTER TABLE `lb-chat` ALTER COLUMN `message` VARCHAR(256) NOT NULL");
|
final Statement st = conn.createStatement();
|
||||||
st.close();
|
st.execute("ALTER TABLE `lb-chat` MODIFY COLUMN `message` VARCHAR(256) NOT NULL");
|
||||||
conn.close();
|
st.close();
|
||||||
} catch (final SQLException ex) {
|
conn.close();
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "[Updater] Error: ", ex);
|
} catch (final SQLException ex) {
|
||||||
return false;
|
Bukkit.getLogger().log(Level.SEVERE, "[Updater] Error: ", ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
config.set("version", "1.12.0");
|
config.set("version", "1.12.0");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user