This commit is contained in:
boy0001 2015-04-17 16:39:45 +10:00
parent 3d30e3abbc
commit 956899cb67
4 changed files with 116 additions and 9 deletions

View file

@ -586,18 +586,11 @@ public class SQLManager implements AbstractDB {
final DatabaseMetaData data = this.connection.getMetaData();
ResultSet rs = data.getColumns(null, null, this.prefix + "plot_comments", "plot_plot_id");
if (rs.next()) {
rs.close();
rs = data.getColumns(null, null, this.prefix + "plot_comments", "hashcode");
if (!rs.next()) {
rs.close();
try {
final Statement statement = this.connection.createStatement();
statement.addBatch("ALTER IGNORE TABLE `" + this.prefix + "plot_comments` ADD `inbox` VARCHAR(11) DEFAULT `public`");
statement.addBatch("ALTER IGNORE TABLE `" + this.prefix + "plot_comments` ADD `timestamp` INT(11) DEFAULT 0");
statement.addBatch("ALTER TABLE `" + this.prefix + "plot` DROP `tier`");
statement.executeBatch();
statement.close();
}
catch (SQLException e) {
final Statement statement = this.connection.createStatement();
statement.addBatch("DROP TABLE `" + this.prefix + "plot_comments`");
if (PlotSquared.getMySQL() != null) {
@ -609,6 +602,14 @@ public class SQLManager implements AbstractDB {
statement.executeBatch();
statement.close();
}
catch (SQLException e) {
final Statement statement = this.connection.createStatement();
statement.addBatch("ALTER IGNORE TABLE `" + this.prefix + "plot_comments` ADD `inbox` VARCHAR(11) DEFAULT `public`");
statement.addBatch("ALTER IGNORE TABLE `" + this.prefix + "plot_comments` ADD `timestamp` INT(11) DEFAULT 0");
statement.addBatch("ALTER TABLE `" + this.prefix + "plot` DROP `tier`");
statement.executeBatch();
statement.close();
}
}
}
rs.close();