mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-12 14:58:26 +02:00
[Fix] Patch System column addition fixes
This affects KillsServerIDPatch and IPHashPatch issues. Affected issues: #732
This commit is contained in:
parent
e72b89571e
commit
92ce37dda3
@ -16,7 +16,7 @@ public class GeoInfoLastUsedPatch extends Patch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() {
|
public void apply() {
|
||||||
addColumns(GeoInfoTable.TABLE_NAME,
|
addColumn(GeoInfoTable.TABLE_NAME,
|
||||||
GeoInfoTable.Col.LAST_USED + " bigint NOT NULL DEFAULT 0"
|
GeoInfoTable.Col.LAST_USED + " bigint NOT NULL DEFAULT 0"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,6 @@ public class IPHashPatch extends Patch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() {
|
public void apply() {
|
||||||
addColumns(GeoInfoTable.Col.IP_HASH.get() + " varchar(200) DEFAULT ''");
|
addColumn(GeoInfoTable.TABLE_NAME, GeoInfoTable.Col.IP_HASH.get() + " varchar(200) DEFAULT ''");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class KillsServerIDPatch extends Patch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() {
|
public void apply() {
|
||||||
addColumns(KillsTable.Col.SERVER_ID + " integer NOT NULL DEFAULT 0");
|
addColumn(KillsTable.TABLE_NAME, KillsTable.Col.SERVER_ID + " integer NOT NULL DEFAULT 0");
|
||||||
|
|
||||||
Map<Integer, Integer> sessionIDServerIDRelation = db.getSessionsTable().getIDServerIDRelation();
|
Map<Integer, Integer> sessionIDServerIDRelation = db.getSessionsTable().getIDServerIDRelation();
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public class NicknameLastSeenPatch extends Patch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() {
|
public void apply() {
|
||||||
addColumns(NicknamesTable.TABLE_NAME,
|
addColumn(NicknamesTable.TABLE_NAME,
|
||||||
NicknamesTable.Col.LAST_USED + " bigint NOT NULL DEFAULT '0'"
|
NicknamesTable.Col.LAST_USED + " bigint NOT NULL DEFAULT '0'"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -78,11 +78,8 @@ public abstract class Patch {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addColumns(String tableName, String... columnInfo) {
|
protected void addColumn(String tableName, String columnInfo) {
|
||||||
for (int i = 0; i < columnInfo.length; i++) {
|
db.executeUnsafe("ALTER TABLE " + tableName + " ADD " + (usingMySQL ? "" : "COLUMN ") + columnInfo);
|
||||||
columnInfo[i] = "ALTER TABLE " + tableName + " ADD " + (usingMySQL ? "" : "COLUMN ") + columnInfo[i];
|
|
||||||
}
|
|
||||||
db.executeUnsafe(columnInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void dropTable(String name) {
|
protected void dropTable(String name) {
|
||||||
|
@ -16,7 +16,7 @@ public class SessionAFKTimePatch extends Patch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() {
|
public void apply() {
|
||||||
addColumns(SessionsTable.TABLE_NAME,
|
addColumn(SessionsTable.TABLE_NAME,
|
||||||
SessionsTable.Col.AFK_TIME + " bigint NOT NULL DEFAULT 0"
|
SessionsTable.Col.AFK_TIME + " bigint NOT NULL DEFAULT 0"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,6 @@ public class TransferPartitionPatch extends Patch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() {
|
public void apply() {
|
||||||
addColumns(TransferTable.TABLE_NAME, TransferTable.Col.PART + " bigint NOT NULL DEFAULT 0");
|
addColumn(TransferTable.TABLE_NAME, TransferTable.Col.PART + " bigint NOT NULL DEFAULT 0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user