Updated schema_version number and added braces around some migration cases to help with re-using variable names

This commit is contained in:
QuantumSno 2023-08-01 14:27:37 -04:00
parent 054ca5e59c
commit 426bc52fd5
1 changed files with 14 additions and 1 deletions

View File

@ -82,8 +82,9 @@ public class RealmAccess : IDisposable
/// 30 2023-06-16 Run migration of old lazer scores again. This time with more correct rounding considerations.
/// 31 2023-06-26 Add Version and LegacyTotalScore to ScoreInfo, set Version to 30000002 and copy TotalScore into LegacyTotalScore for legacy scores.
/// 32 2023-07-09 Populate legacy scores with the ScoreV2 mod (and restore TotalScore to the legacy total for such scores) using replay files.
/// 32 2023-08-01 Added a new keybind that toggles the in-game leaderboard on and off
/// </summary>
private const int schema_version = 32;
private const int schema_version = 33;
/// <summary>
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
@ -771,6 +772,7 @@ void convertOnlineIDs<T>() where T : RealmObject
break;
case 8:
{
// Ctrl -/+ now adjusts UI scale so let's clear any bindings which overlap these combinations.
// New defaults will be populated by the key store afterwards.
var keyBindings = migration.NewRealm.All<RealmKeyBinding>();
@ -784,6 +786,7 @@ void convertOnlineIDs<T>() where T : RealmObject
migration.NewRealm.Remove(decreaseSpeedBinding);
break;
}
case 9:
// Pretty pointless to do this as beatmaps aren't really loaded via realm yet, but oh well.
@ -838,6 +841,7 @@ void convertOnlineIDs<T>() where T : RealmObject
break;
case 11:
{
string keyBindingClassName = getMappedOrOriginalName(typeof(RealmKeyBinding));
if (!migration.OldRealm.Schema.TryFindObjectSchema(keyBindingClassName, out _))
@ -864,6 +868,7 @@ void convertOnlineIDs<T>() where T : RealmObject
}
break;
}
case 14:
foreach (var beatmap in migration.NewRealm.All<BeatmapInfo>())
@ -1012,6 +1017,14 @@ void convertOnlineIDs<T>() where T : RealmObject
break;
}
case 33:
{
var oldKeyBinds = migration.NewRealm.All<RealmKeyBinding>();
var newKeyBinds = migration.NewRealm.All<RealmKeyBinding>();
break;
}
}
Logger.Log($"Migration completed in {stopwatch.ElapsedMilliseconds}ms");