using Jellyfin.Data.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Jellyfin.Server.Implementations.ModelConfiguration
{
///
/// FluentAPI configuration for the DisplayPreferencesConfiguration entity.
///
public class DisplayPreferencesConfiguration : IEntityTypeConfiguration
{
///
public void Configure(EntityTypeBuilder builder)
{
// Delete behaviour
builder
.HasMany(d => d.HomeSections)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
// Indexes
builder
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
.IsUnique();
}
}
}