From 9eba50d9db5e8c8ccadf131db0f9f35ff1a1725d Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Fri, 8 Oct 2021 08:49:10 -0500 Subject: [PATCH] New: Log which DB is being migrated (cherry picked from Sonarr commit 07c95f06d3b9b32aaeb923d4c678f10a2bf1141a) --- .../Migration/Framework/NzbDroneMigrationBase.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneMigrationBase.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneMigrationBase.cs index 96cd14011..20971d097 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneMigrationBase.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneMigrationBase.cs @@ -41,15 +41,18 @@ namespace NzbDrone.Core.Datastore.Migration.Framework switch (MigrationContext.Current.MigrationType) { case MigrationType.Main: - _logger.Info("Starting migration to " + Version); + LogMigrationMessage(MigrationType.Main); MainDbUpgrade(); return; case MigrationType.Log: - _logger.Info("Starting migration to " + Version); + LogMigrationMessage(MigrationType.Log); LogDbUpgrade(); return; default: + LogMigrationMessage(MigrationType.Log); LogDbUpgrade(); + + LogMigrationMessage(MigrationType.Main); MainDbUpgrade(); return; } @@ -59,5 +62,10 @@ namespace NzbDrone.Core.Datastore.Migration.Framework { throw new NotImplementedException(); } + + private void LogMigrationMessage(MigrationType type) + { + _logger.Info("Starting migration of {0} DB to {1}", type.ToString(), Version); + } } }