mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-15 20:51:21 +01:00
Fixed Drop table statements for temp_users (mysql)
This commit is contained in:
parent
458638d3f2
commit
d325cf8125
@ -53,15 +53,18 @@ public class Version8TransferTable extends Table {
|
|||||||
|
|
||||||
execute(dropTableSql("plan_ips"));
|
execute(dropTableSql("plan_ips"));
|
||||||
db.getIpsTable().createTable();
|
db.getIpsTable().createTable();
|
||||||
|
|
||||||
execute(dropTableSql("plan_sessions"));
|
|
||||||
db.getSessionsTable().createTable();
|
|
||||||
|
|
||||||
execute(dropTableSql("plan_world_times"));
|
execute(dropTableSql("plan_world_times"));
|
||||||
execute(dropTableSql("plan_worlds"));
|
execute(dropTableSql("plan_worlds"));
|
||||||
db.getWorldTable().createTable();
|
db.getWorldTable().createTable();
|
||||||
db.getWorldTimesTable().createTable();
|
db.getWorldTimesTable().createTable();
|
||||||
|
execute(dropTableSql("plan_user_info"));
|
||||||
|
execute(dropTableSql("plan_actions"));
|
||||||
|
db.getActionsTable().createTable();
|
||||||
|
db.getUserInfoTable().createTable();
|
||||||
execute(dropTableSql("plan_gamemodetimes"));
|
execute(dropTableSql("plan_gamemodetimes"));
|
||||||
|
execute(dropTableSql("temp_nicks"));
|
||||||
|
execute(dropTableSql("temp_kills"));
|
||||||
|
execute(dropTableSql("temp_users"));
|
||||||
|
|
||||||
db.setVersion(10);
|
db.setVersion(10);
|
||||||
Benchmark.stop("Schema copy from 8 to 10");
|
Benchmark.stop("Schema copy from 8 to 10");
|
||||||
@ -84,8 +87,6 @@ public class Version8TransferTable extends Table {
|
|||||||
nicknamesTable.createTable();
|
nicknamesTable.createTable();
|
||||||
execute(dropTableSql("plan_sessions"));
|
execute(dropTableSql("plan_sessions"));
|
||||||
db.getSessionsTable().createTable();
|
db.getSessionsTable().createTable();
|
||||||
execute("INSERT INTO plan_sessions (id, user_id, server_id, session_start, session_end, mob_kills, deaths) " +
|
|
||||||
"VALUES (0, 1, 1, 0, 0, 0, 0)");
|
|
||||||
killsTable.createTable();
|
killsTable.createTable();
|
||||||
|
|
||||||
UserInfoTable userInfoTable = db.getUserInfoTable();
|
UserInfoTable userInfoTable = db.getUserInfoTable();
|
||||||
@ -112,6 +113,10 @@ public class Version8TransferTable extends Table {
|
|||||||
"user_id, nickname, '" + serverID + "'" +
|
"user_id, nickname, '" + serverID + "'" +
|
||||||
" FROM " + tempNickTableName;
|
" FROM " + tempNickTableName;
|
||||||
execute(statement);
|
execute(statement);
|
||||||
|
try {
|
||||||
|
if (usingMySQL) {
|
||||||
|
execute("SET foreign_key_checks = 0");
|
||||||
|
}
|
||||||
statement = "INSERT INTO plan_kills " +
|
statement = "INSERT INTO plan_kills " +
|
||||||
"(" +
|
"(" +
|
||||||
"killer_id, victim_id, weapon, date, session_id" +
|
"killer_id, victim_id, weapon, date, session_id" +
|
||||||
@ -119,10 +124,11 @@ public class Version8TransferTable extends Table {
|
|||||||
"killer_id, victim_id, weapon, date, '0'" +
|
"killer_id, victim_id, weapon, date, '0'" +
|
||||||
" FROM " + tempKillsTableName;
|
" FROM " + tempKillsTableName;
|
||||||
execute(statement);
|
execute(statement);
|
||||||
|
} finally {
|
||||||
execute(dropTableSql(tempTableName));
|
if (usingMySQL) {
|
||||||
execute(dropTableSql(tempNickTableName));
|
execute("SET foreign_key_checks = 1");
|
||||||
execute(dropTableSql(tempKillsTableName));
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyCommandUsage() throws SQLException, DBCreateTableException {
|
private void copyCommandUsage() throws SQLException, DBCreateTableException {
|
||||||
|
Loading…
Reference in New Issue
Block a user