Fix KillsOptimizationPatch applying improperly with KillsServerIDPatch

This commit is contained in:
Rsl1122 2019-01-27 12:16:30 +02:00
parent 610cbf955d
commit 1e20f078aa

View File

@ -39,7 +39,7 @@ public class KillsServerIDPatch extends Patch {
// KillsOptimizationPatch makes this patch incompatible with newer patch versions.
return hasColumn(tableName, KillsTable.Col.SERVER_UUID.get())
|| hasColumn(tableName, columnName) && allValuesHaveServerID(tableName, columnName);
|| (hasColumn(tableName, columnName) && allValuesHaveServerID(tableName, columnName));
}
private Boolean allValuesHaveServerID(String tableName, String columnName) {
@ -59,6 +59,10 @@ public class KillsServerIDPatch extends Patch {
@Override
protected void applyPatch() {
if (hasColumn(KillsTable.TABLE_NAME, KillsTable.Col.SERVER_UUID.get())) {
return;
}
addColumn(KillsTable.TABLE_NAME, "server_id integer NOT NULL DEFAULT 0");
Map<Integer, Integer> sessionIDServerIDRelation = db.getSessionsTable().getIDServerIDRelation();