mirror of
https://github.com/ppy/osu
synced 2024-12-27 09:23:15 +00:00
Move log statement about migration completed closer to rest of migration code
This commit is contained in:
parent
1b2cca4a0d
commit
7e68371d28
@ -5,7 +5,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using osu.Framework.Development;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Statistics;
|
||||
@ -151,9 +150,6 @@ namespace osu.Game.Database
|
||||
{
|
||||
Logger.Log($"Creating full EF database backup at {backupFilename}", LoggingTarget.Database);
|
||||
|
||||
if (DebugUtils.IsDebugBuild)
|
||||
Logger.Log("Your development database has been fully migrated to realm. If you switch back to a pre-realm branch and need your previous database, rename the backup file back to \"client.db\".\n\nNote that doing this can potentially leave your file store in a bad state.", level: LogLevel.Important);
|
||||
|
||||
using (var source = storage.GetStream(DATABASE_NAME))
|
||||
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
||||
source.CopyTo(destination);
|
||||
|
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Development;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Logging;
|
||||
@ -108,6 +109,9 @@ namespace osu.Game.Database
|
||||
// Will cause future startups to not attempt migration.
|
||||
log("Migration successful, deleting EF database");
|
||||
efContextFactory.ResetDatabase();
|
||||
|
||||
if (DebugUtils.IsDebugBuild)
|
||||
Logger.Log("Your development database has been fully migrated to realm. If you switch back to a pre-realm branch and need your previous database, rename the backup file back to \"client.db\".\n\nNote that doing this can potentially leave your file store in a bad state.", level: LogLevel.Important);
|
||||
}, TaskCreationOptions.LongRunning).ContinueWith(t =>
|
||||
{
|
||||
FinishedMigrating = true;
|
||||
|
Loading…
Reference in New Issue
Block a user