mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
sql-create-tables-and-migrations.sp - AddStylePoints migration
This commit is contained in:
parent
88e0a78b08
commit
aab9f9c271
@ -55,6 +55,7 @@ enum
|
||||
Migration_FixSQLiteMapzonesROWID,
|
||||
Migration_AddUsersFirstLogin, // 30
|
||||
Migration_MoreFirstLoginStuff,
|
||||
Migration_AddStylePoints,
|
||||
MIGRATIONS_END
|
||||
};
|
||||
|
||||
@ -91,6 +92,7 @@ char gS_MigrationNames[][] = {
|
||||
"FixSQLiteMapzonesROWID",
|
||||
"AddUsersFirstLogin",
|
||||
"MoreFirstLoginStuff",
|
||||
"AddStylePoints",
|
||||
};
|
||||
|
||||
static Database gH_SQL;
|
||||
@ -380,6 +382,7 @@ void ApplyMigration(int migration)
|
||||
case Migration_FixSQLiteMapzonesROWID: ApplyMigration_FixSQLiteMapzonesROWID();
|
||||
case Migration_AddUsersFirstLogin: ApplyMigration_AddUsersFirstLogin();
|
||||
case Migration_MoreFirstLoginStuff: ApplyMigration_MoreFirstLoginStuff();
|
||||
case Migration_AddStylePoints: ApplyMigration_AddStylePoints();
|
||||
}
|
||||
}
|
||||
|
||||
@ -773,6 +776,13 @@ public void ApplyMigration_MoreFirstLoginStuff()
|
||||
gH_SQL.Execute(trans, Trans_MigrationSimple, TransMigrationSimple_Error, Migration_MoreFirstLoginStuff);
|
||||
}
|
||||
|
||||
void ApplyMigration_AddStylePoints()
|
||||
{
|
||||
char sQuery[256];
|
||||
FormatEx(sQuery, sizeof(sQuery), "INSERT INTO %sstylepoints (auth, style) SELECT UNIQUE auth, style FROM %splayertimes;", gS_SQLPrefix, gS_SQLPrefix);
|
||||
QueryLog(gH_SQL, SQL_TableMigrationSingleQuery_Callback, sQuery, Migration_AddStylePoints, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_TableMigrationSingleQuery_Callback(Database db, DBResultSet results, const char[] error, any data)
|
||||
{
|
||||
InsertMigration(data);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user