Properly configure foreign keys

This commit is contained in:
Patrick Barron 2021-03-19 00:26:00 -04:00
parent a07ad71222
commit ea0a9c2cca

View File

@ -165,11 +165,13 @@ namespace Jellyfin.Server.Implementations
modelBuilder.Entity<User>()
.HasMany(u => u.Permissions)
.WithOne()
.HasForeignKey(p => p.UserId)
.OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<User>()
.HasMany(u => u.Preferences)
.WithOne()
.HasForeignKey(p => p.UserId)
.OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<User>()