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); // Index for efficient lookups and deletes by ItemId builder.HasIndex(e => e.ItemId); // Composite index for filtering by item and image type builder.HasIndex(e => new { e.ItemId, e.ImageType }); } }