mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-11 14:20:54 +01:00
Fixes #353 on new databases and existing MySQL databases
This commit is contained in:
parent
e7fbee7991
commit
7790058bbe
@ -132,6 +132,7 @@ public abstract class SQLDB extends Database {
|
||||
setVersion(11);
|
||||
}
|
||||
if (version < 12) {
|
||||
actionsTable.alterTableV12();
|
||||
ipsTable.alterTableV12();
|
||||
setVersion(12);
|
||||
}
|
||||
|
@ -68,12 +68,18 @@ public class ActionsTable extends UserIDTable {
|
||||
.column(columnServerID, Sql.INT).notNull()
|
||||
.column(columnDate, Sql.LONG).notNull()
|
||||
.column(columnActionID, Sql.INT).notNull()
|
||||
.column(columnAdditionalInfo, Sql.varchar(100))
|
||||
.column(columnAdditionalInfo, Sql.varchar(300))
|
||||
.foreignKey(columnUserID, usersTable.toString(), usersTable.getColumnID())
|
||||
.foreignKey(columnServerID, serverTable.toString(), serverTable.getColumnID())
|
||||
.toString());
|
||||
}
|
||||
|
||||
public void alterTableV12() throws SQLException {
|
||||
if (usingMySQL) {
|
||||
executeUnsafe("ALTER TABLE " + tableName + " MODIFY " + columnAdditionalInfo + " VARCHAR(300)");
|
||||
}
|
||||
}
|
||||
|
||||
public void insertAction(UUID uuid, Action action) throws SQLException {
|
||||
execute(new ExecStatement(insertStatement) {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user