aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/ModelConfiguration/PeopleBaseItemMapConfiguration.cs
blob: cdaee9161c0a0f0c6100c4a0b59d4a96a2b0eee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using Jellyfin.Data.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Jellyfin.Server.Implementations.ModelConfiguration;

/// <summary>
/// People configuration.
/// </summary>
public class PeopleBaseItemMapConfiguration : IEntityTypeConfiguration<PeopleBaseItemMap>
{
    /// <inheritdoc/>
    public void Configure(EntityTypeBuilder<PeopleBaseItemMap> builder)
    {
        builder.HasKey(e => new { e.ItemId, e.PeopleId });
        builder.HasIndex(e => new { e.ItemId, e.SortOrder });
        builder.HasIndex(e => new { e.ItemId, e.ListOrder });
        builder.HasOne(e => e.Item);
        builder.HasOne(e => e.People);
    }
}