using System;
using Jellyfin.Data.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Jellyfin.Server.Implementations.ModelConfiguration;
///
/// AncestorId configuration.
///
public class AncestorIdConfiguration : IEntityTypeConfiguration
{
///
public void Configure(EntityTypeBuilder builder)
{
builder.HasKey(e => new { e.ItemId, e.ParentItemId });
builder.HasIndex(e => e.ParentItemId);
builder.HasOne(e => e.ParentItem);
builder.HasOne(e => e.Item);
}
}