mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:07:38 +08:00
Fix realm migration failures when upgrading from old versions
* `RealmRulesetSetting` was added in 2021.916.0. * `RealmKeyBinding` was added in 2021.703.0. Attempting to upgrade from older releases than the above would cause migrations up to schema versions 10 and 11 to fail.
This commit is contained in:
parent
51a7c60eec
commit
93b5aec23e
@ -307,6 +307,9 @@ namespace osu.Game.Database
|
||||
case 10:
|
||||
string rulesetSettingClassName = getMappedOrOriginalName(typeof(RealmRulesetSetting));
|
||||
|
||||
if (!migration.OldRealm.Schema.TryFindObjectSchema(rulesetSettingClassName, out _))
|
||||
return;
|
||||
|
||||
var oldSettings = migration.OldRealm.DynamicApi.All(rulesetSettingClassName);
|
||||
var newSettings = migration.NewRealm.All<RealmRulesetSetting>().ToList();
|
||||
|
||||
@ -329,6 +332,9 @@ namespace osu.Game.Database
|
||||
case 11:
|
||||
string keyBindingClassName = getMappedOrOriginalName(typeof(RealmKeyBinding));
|
||||
|
||||
if (!migration.OldRealm.Schema.TryFindObjectSchema(keyBindingClassName, out _))
|
||||
return;
|
||||
|
||||
var oldKeyBindings = migration.OldRealm.DynamicApi.All(keyBindingClassName);
|
||||
var newKeyBindings = migration.NewRealm.All<RealmKeyBinding>().ToList();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user