mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Configure user deletion behavior
This commit is contained in:
parent
3ffef5794e
commit
0a579e5bbd
@ -149,6 +149,31 @@ namespace Jellyfin.Server.Implementations
|
|||||||
|
|
||||||
modelBuilder.HasDefaultSchema("jellyfin");
|
modelBuilder.HasDefaultSchema("jellyfin");
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>()
|
||||||
|
.HasOne(u => u.ProfileImage)
|
||||||
|
.WithOne()
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>()
|
||||||
|
.HasMany(u => u.Permissions)
|
||||||
|
.WithOne()
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>()
|
||||||
|
.HasMany(u => u.Preferences)
|
||||||
|
.WithOne()
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>()
|
||||||
|
.HasMany(u => u.AccessSchedules)
|
||||||
|
.WithOne()
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>()
|
||||||
|
.HasMany(u => u.DisplayPreferences)
|
||||||
|
.WithOne()
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
modelBuilder.Entity<DisplayPreferences>()
|
modelBuilder.Entity<DisplayPreferences>()
|
||||||
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
|
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
Loading…
Reference in New Issue
Block a user