2025-03-25 16:45:00 +01:00
|
|
|
using Jellyfin.Database.Implementations.Entities;
|
2024-09-08 16:56:14 +00:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
|
2025-03-25 15:30:22 +00:00
|
|
|
namespace Jellyfin.Database.Implementations.ModelConfiguration;
|
2024-09-08 16:56:14 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// itemvalues Configuration.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class ItemValuesConfiguration : IEntityTypeConfiguration<ItemValue>
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public void Configure(EntityTypeBuilder<ItemValue> builder)
|
|
|
|
|
{
|
2024-10-10 14:32:49 +00:00
|
|
|
builder.HasKey(e => e.ItemValueId);
|
2025-04-05 17:57:58 +02:00
|
|
|
builder.HasIndex(e => new { e.Type, e.CleanValue });
|
|
|
|
|
builder.HasIndex(e => new { e.Type, e.Value }).IsUnique();
|
2024-09-08 16:56:14 +00:00
|
|
|
}
|
|
|
|
|
}
|