The Free Software Media System - Server Backend & API
Fixed migration referencing non-existing Items
JPVenson19e55f430971
diff --git a/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs b/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.csindex de48941989..4a379a183b 100644--- a/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs+++ b/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs@@ -109,7 +109,11 @@ public class MigrateLibraryDb : IMigrationRoutine_logger.LogInformation("Start moving ItemValues.");// do not migrate inherited types as they are now properly mapped in search and lookup.- var itemValueQuery = "select ItemId, Type, Value, CleanValue FROM ItemValues WHERE Type <> 6";+ var itemValueQuery =+ """+ SELECT ItemId, Type, Value, CleanValue FROM ItemValues+ WHERE Type <> 6 AND EXISTS(SELECT 1 FROM TypedBaseItems WHERE TypedBaseItems.guid = ItemValues.ItemId)+ """;dbContext.ItemValues.ExecuteDelete();// EFCores local lookup sucks. We cannot use context.ItemValues.Local here because its just super slow.