mirror of
https://github.com/ppy/osu.git
synced 2025-02-06 04:12:55 +08: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.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Microsoft.EntityFrameworkCore.Storage;
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
using osu.Framework.Development;
|
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Statistics;
|
using osu.Framework.Statistics;
|
||||||
@ -151,9 +150,6 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
Logger.Log($"Creating full EF database backup at {backupFilename}", LoggingTarget.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 source = storage.GetStream(DATABASE_NAME))
|
||||||
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
||||||
source.CopyTo(destination);
|
source.CopyTo(destination);
|
||||||
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Development;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
@ -108,6 +109,9 @@ namespace osu.Game.Database
|
|||||||
// Will cause future startups to not attempt migration.
|
// Will cause future startups to not attempt migration.
|
||||||
log("Migration successful, deleting EF database");
|
log("Migration successful, deleting EF database");
|
||||||
efContextFactory.ResetDatabase();
|
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 =>
|
}, TaskCreationOptions.LongRunning).ContinueWith(t =>
|
||||||
{
|
{
|
||||||
FinishedMigrating = true;
|
FinishedMigrating = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user