mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-05 16:30:24 +08:00
Fixes #355 on existing MySQL databases
This commit is contained in:
parent
889b2ac045
commit
e7fbee7991
@ -109,7 +109,7 @@ public abstract class SQLDB extends Database {
|
||||
|
||||
if (newDatabase) {
|
||||
Log.info("New Database created.");
|
||||
setVersion(11);
|
||||
setVersion(12);
|
||||
}
|
||||
|
||||
int version = getVersion();
|
||||
@ -131,6 +131,10 @@ public abstract class SQLDB extends Database {
|
||||
serverTable.alterTableV11();
|
||||
setVersion(11);
|
||||
}
|
||||
if (version < 12) {
|
||||
ipsTable.alterTableV12();
|
||||
setVersion(12);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DatabaseInitException("Failed to set-up Database", e);
|
||||
}
|
||||
|
@ -50,6 +50,12 @@ public class IPsTable extends UserIDTable {
|
||||
);
|
||||
}
|
||||
|
||||
public void alterTableV12() throws SQLException {
|
||||
if (usingMySQL) {
|
||||
executeUnsafe("ALTER TABLE " + tableName + " MODIFY " + columnIP + " VARCHAR(39) NOT NULL");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uuid UUID of the user.
|
||||
* @return Users's Login Geolocations.
|
||||
|
Loading…
Reference in New Issue
Block a user