mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fixed migration referencing non-existing Items
This commit is contained in:
parent
92eb983c61
commit
19e55f4309
@ -109,7 +109,11 @@ public class MigrateLibraryDb : IMigrationRoutine
|
|||||||
|
|
||||||
_logger.LogInformation("Start moving ItemValues.");
|
_logger.LogInformation("Start moving ItemValues.");
|
||||||
// do not migrate inherited types as they are now properly mapped in search and lookup.
|
// 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();
|
dbContext.ItemValues.ExecuteDelete();
|
||||||
|
|
||||||
// EFCores local lookup sucks. We cannot use context.ItemValues.Local here because its just super slow.
|
// EFCores local lookup sucks. We cannot use context.ItemValues.Local here because its just super slow.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user