aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-07-18 02:19:41 +0300
committerGitHub <noreply@github.com>2025-07-17 17:19:41 -0600
commit21a6d6f0d61c4a24e2a899c57ad351f4632fb4f9 (patch)
treef59db2fa3383e5c4c3a73a572a3aad80dbf7e8e6
parentaa77dfb92dded85eeac6b480f09cb2119a9c5a56 (diff)
Delete old migrations on restore (#14486)
-rw-r--r--Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs b/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs
index d439fcb18..6e8936d53 100644
--- a/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs
+++ b/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs
@@ -165,6 +165,13 @@ public class BackupService : IBackupService
var historyRepository = dbContext.GetService<IHistoryRepository>();
await historyRepository.CreateIfNotExistsAsync().ConfigureAwait(false);
+
+ foreach (var item in await historyRepository.GetAppliedMigrationsAsync(CancellationToken.None).ConfigureAwait(false))
+ {
+ var insertScript = historyRepository.GetDeleteScript(item.MigrationId);
+ await dbContext.Database.ExecuteSqlRawAsync(insertScript).ConfigureAwait(false);
+ }
+
foreach (var item in historyEntries)
{
var insertScript = historyRepository.GetInsertScript(item);