Migration Exception handling

This commit is contained in:
Michael Bucari-Tovo 2022-06-12 16:35:48 -06:00
parent fa195483d6
commit b7b49a60cf

View File

@ -405,6 +405,13 @@ namespace AppScaffolding
public static void migrate_from_7_10_1(Configuration config) public static void migrate_from_7_10_1(Configuration config)
{ {
var lastNigrationThres = config.GetNonString<bool>($"{nameof(migrate_from_7_10_1)}_ThrewError");
if (lastNigrationThres) return;
try
{
//https://github.com/rmcrackan/Libation/issues/270#issuecomment-1152863629 //https://github.com/rmcrackan/Libation/issues/270#issuecomment-1152863629
//This migration helps fix databases contaminated with the 7.10.1 hack workaround //This migration helps fix databases contaminated with the 7.10.1 hack workaround
//and those with improperly identified or missing series. This does not solve cases //and those with improperly identified or missing series. This does not solve cases
@ -458,5 +465,11 @@ namespace AppScaffolding
LibraryCommands.SaveContext(context); LibraryCommands.SaveContext(context);
} }
catch (Exception ex)
{
Serilog.Log.Logger.Error(ex, "An error occured while running database migrations in {0}", nameof(migrate_from_7_10_1));
config.SetObject($"{nameof(migrate_from_7_10_1)}_ThrewError", true);
}
}
} }
} }