Removed manual Migrate Series Relations migration from v0.7 release (5 releases ago). (#2158)
Don't try to backup the DB if it doesn't exist. This will stop errors in log on first start.
This commit is contained in:
parent
1fbb9d0f52
commit
c343764913
4 changed files with 3 additions and 177 deletions
|
@ -70,7 +70,8 @@ public class Program
|
|||
var logger = services.GetRequiredService<ILogger<Program>>();
|
||||
var context = services.GetRequiredService<DataContext>();
|
||||
var pendingMigrations = await context.Database.GetPendingMigrationsAsync();
|
||||
if (pendingMigrations.Any())
|
||||
var isDbCreated = await context.Database.CanConnectAsync();
|
||||
if (isDbCreated && pendingMigrations.Any())
|
||||
{
|
||||
logger.LogInformation("Performing backup as migrations are needed. Backup will be kavita.db in temp folder");
|
||||
var migrationDirectory = await GetMigrationDirectory(context, directoryService);
|
||||
|
@ -84,16 +85,6 @@ public class Program
|
|||
}
|
||||
}
|
||||
|
||||
// This must run before the migration
|
||||
try
|
||||
{
|
||||
await MigrateSeriesRelationsExport.Migrate(context, logger);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// If fresh install, could fail and we should just carry on as it's not applicable
|
||||
}
|
||||
|
||||
await context.Database.MigrateAsync();
|
||||
|
||||
await Seed.SeedRoles(services.GetRequiredService<RoleManager<AppRole>>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue