mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-26 18:54:44 +02:00
Fix issue with tables without party names.
This commit is contained in:
@ -150,6 +150,8 @@ public final class SQLDatabaseManager {
|
||||
checkDatabaseStructure(DatabaseUpdateType.BLAST_MINING);
|
||||
checkDatabaseStructure(DatabaseUpdateType.INDEX);
|
||||
checkDatabaseStructure(DatabaseUpdateType.MOB_HEALTHBARS);
|
||||
checkDatabaseStructure(DatabaseUpdateType.PARTY_NAMES);
|
||||
checkDatabaseStructure(DatabaseUpdateType.USER_COLUMN);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,7 +172,9 @@ public final class SQLDatabaseManager {
|
||||
return true;
|
||||
}
|
||||
catch (SQLException ex) {
|
||||
printErrors(ex);
|
||||
if (!sql.equalsIgnoreCase("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party` ;")) {
|
||||
printErrors(ex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
finally {
|
||||
@ -566,6 +570,14 @@ public final class SQLDatabaseManager {
|
||||
sql = "SELECT * FROM `" + tablePrefix + "huds` ORDER BY `" + tablePrefix + "huds`.`mobhealthbar` ASC LIMIT 0 , 30";
|
||||
break;
|
||||
|
||||
case PARTY_NAMES:
|
||||
write("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party` ;");
|
||||
break;
|
||||
|
||||
case USER_COLUMN:
|
||||
sql = "SELECT * FROM `" + tablePrefix + "users` ORDER BY `" + tablePrefix + "users`.`user` ASC LIMIT 0 , 30";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -607,6 +619,10 @@ public final class SQLDatabaseManager {
|
||||
write("ALTER TABLE `" + tablePrefix + "huds` ADD `mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "' ;");
|
||||
break;
|
||||
|
||||
case USER_COLUMN:
|
||||
mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for user column name...");
|
||||
write("ALTER TABLE `" + tablePrefix + "users` RENAME COLUMN `userr` to `user`;");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user