added logging for startup issues
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Oqtane.Enums;
|
||||
@ -16,27 +14,18 @@ namespace Oqtane.Modules
|
||||
|
||||
using (dbContext)
|
||||
{
|
||||
try
|
||||
var migrator = dbContext.GetService<IMigrator>();
|
||||
if (migrationType == MigrationType.Down)
|
||||
{
|
||||
var migrator = dbContext.GetService<IMigrator>();
|
||||
if (migrationType == MigrationType.Down)
|
||||
{
|
||||
migrator.Migrate(Migration.InitialDatabase);
|
||||
}
|
||||
else
|
||||
{
|
||||
migrator.Migrate();
|
||||
}
|
||||
migrator.Migrate(Migration.InitialDatabase);
|
||||
}
|
||||
catch (Exception ex)
|
||||
else
|
||||
{
|
||||
Debug.WriteLine($"Oqtane Error: Error Executing Migration - {ex}");
|
||||
result = false;
|
||||
migrator.Migrate();
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user