From ef8359dd2e4eff159e998921874c3739fb45b34d Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 14 Mar 2024 07:12:11 +0100 Subject: [PATCH] Storage - Don't attempt to migrate if already done so but failed to remove the old DB --- src/Artemis.Storage.Legacy/LegacyMigrationService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Artemis.Storage.Legacy/LegacyMigrationService.cs b/src/Artemis.Storage.Legacy/LegacyMigrationService.cs index 1c3b35d4f..4327ed0f4 100644 --- a/src/Artemis.Storage.Legacy/LegacyMigrationService.cs +++ b/src/Artemis.Storage.Legacy/LegacyMigrationService.cs @@ -24,6 +24,14 @@ public static class LegacyMigrationService logger.Information("No legacy database found, nothing to migrate"); return; } + + // If the legacy database has already been migrated, but the old DB failed to be deleted, we don't want to migrate again + // In a future update we'll clean up the old DB if it's still there, for now lets leave people's files alone + if (File.Exists(Path.Combine(Constants.DataFolder, "legacy.db"))) + { + logger.Information("Legacy database already migrated, nothing to do"); + return; + } using ArtemisDbContext dbContext = container.Resolve(); MigrateToSqlite(logger, dbContext);