New: Log which DB is being migrated

Closes #4669
This commit is contained in:
Mark McDowall 2021-10-02 19:00:25 -07:00
parent ad9f242b5c
commit 07c95f06d3
1 changed files with 10 additions and 2 deletions

View File

@ -54,15 +54,18 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
switch (Context.MigrationType) switch (Context.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;
default: default:
LogMigrationMessage(MigrationType.Log);
LogDbUpgrade(); LogDbUpgrade();
LogMigrationMessage(MigrationType.Main);
MainDbUpgrade(); MainDbUpgrade();
return; return;
} }
@ -72,5 +75,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);
}
} }
} }