Run EF migrations earlier to ensure it is complete before usage

This commit is contained in:
Dean Herbert 2021-11-23 11:48:56 +09:00
parent 329bae50b0
commit 1f321e2910

View File

@ -187,6 +187,9 @@ namespace osu.Game
Resources.AddStore(new DllResourceStore(OsuResources.ResourceAssembly));
dependencies.Cache(contextFactory = new DatabaseContextFactory(Storage));
runMigrations();
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory, Storage));
dependencies.Cache(realmFactory = new RealmContextFactory(Storage, "client", RulesetStore));
@ -204,8 +207,6 @@ namespace osu.Game
Audio.Samples.PlaybackConcurrency = SAMPLE_CONCURRENCY;
runMigrations();
dependencies.Cache(SkinManager = new SkinManager(Storage, contextFactory, Host, Resources, Audio));
dependencies.CacheAs<ISkinSource>(SkinManager);