Skip to content

Commit

Permalink
Removed manual Migrate Series Relations migration from v0.7 release (…
Browse files Browse the repository at this point in the history
…5 releases ago).

Don't try to backup the DB if it doesn't exist. This will stop errors in log on first start.
  • Loading branch information
majora2007 committed Jul 25, 2023
1 parent 1fbb9d0 commit 1bb30ec
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 177 deletions.
103 changes: 0 additions & 103 deletions API/Data/ManualMigrations/MigrateSeriesRelationsExport.cs

This file was deleted.

62 changes: 0 additions & 62 deletions API/Data/ManualMigrations/MigrateSeriesRelationsImport.cs

This file was deleted.

13 changes: 2 additions & 11 deletions API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public static async Task Main(string[] args)
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);
Expand All @@ -84,16 +85,6 @@ public static async Task Main(string[] args)
}
}

// 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>>());
Expand Down
2 changes: 1 addition & 1 deletion openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "GPL-3.0",
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
},
"version": "0.7.5.4"
"version": "0.7.5.5"
},
"servers": [
{
Expand Down

0 comments on commit 1bb30ec

Please sign in to comment.