New: Log which DB is being migrated

(cherry picked from commit 07c95f06d3b9b32aaeb923d4c678f10a2bf1141a)
pull/1274/head
Mark McDowall 3 years ago committed by Qstick
parent 398ab902dc
commit af2e743994

@ -45,11 +45,11 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
switch (MigrationContext.Current.MigrationType) switch (MigrationContext.Current.MigrationType)
{ {
case MigrationType.Main: case MigrationType.Main:
_logger.Info("Starting migration to " + Version); LogMigrationMessage(MigrationType.Main);
MainDbUpgrade(); MainDbUpgrade();
return; return;
case MigrationType.Log: case MigrationType.Log:
_logger.Info("Starting migration to " + Version); LogMigrationMessage(MigrationType.Log);
LogDbUpgrade(); LogDbUpgrade();
return; return;
case MigrationType.Cache: case MigrationType.Cache:
@ -58,7 +58,10 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
return; return;
default: default:
LogMigrationMessage(MigrationType.Log);
LogDbUpgrade(); LogDbUpgrade();
LogMigrationMessage(MigrationType.Main);
MainDbUpgrade(); MainDbUpgrade();
return; return;
} }
@ -68,5 +71,10 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
private void LogMigrationMessage(MigrationType type)
{
_logger.Info("Starting migration of {0} DB to {1}", type.ToString(), Version);
}
} }
} }

Loading…
Cancel
Save