using Jellyfin.Database.Implementations.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Jellyfin.Database.Implementations.ModelConfiguration;
///
/// FluentAPI configuration for the BaseItemImageInfo entity.
///
public class BaseItemImageInfoConfiguration : IEntityTypeConfiguration
{
///
public void Configure(EntityTypeBuilder builder)
{
builder.HasKey(e => e.Id);
builder.HasOne(e => e.Item).WithMany(e => e.Images).HasForeignKey(e => e.ItemId);
// Composite index for filtering by item and image type (also covers ItemId-only lookups)
builder.HasIndex(e => new { e.ItemId, e.ImageType });
}
}