Files
ersatztv/ErsatzTV.Infrastructure/Data/Configurations/Library/JellyfinLibraryConfiguration.cs
T
Jason DoveandGitHub 14d2dd0c3a optimize jellyfin database fields and indexes (#2746)
* optimize jellyfin database fields and indexes

* copy paste
2025-12-31 14:30:53 -06:00

24 lines
653 B
C#

using ErsatzTV.Core.Domain;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace ErsatzTV.Infrastructure.Data.Configurations;
public class JellyfinLibraryConfiguration : IEntityTypeConfiguration<JellyfinLibrary>
{
public void Configure(EntityTypeBuilder<JellyfinLibrary> builder)
{
builder.ToTable("JellyfinLibrary");
builder.HasMany(l => l.PathInfos)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
builder.Property(l => l.ItemId)
.HasMaxLength(36)
.IsUnicode(false);
builder.HasIndex(l => l.ItemId);
}
}