Migrated UserData from library sqlite db to jellyfin.db

This commit is contained in:
JPVenson
2024-09-07 19:07:34 +00:00
committed by GitHub
parent 57452d65ef
commit d0b4b2ddb3
17 changed files with 1244 additions and 491 deletions

View File

@@ -0,0 +1,23 @@
using System;
using Jellyfin.Data.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Jellyfin.Server.Implementations.ModelConfiguration;
/// <summary>
/// FluentAPI configuration for the UserData entity.
/// </summary>
public class UserDataConfiguration : IEntityTypeConfiguration<UserData>
{
/// <inheritdoc/>
public void Configure(EntityTypeBuilder<UserData> builder)
{
builder.HasNoKey();
builder.HasIndex(d => new { d.Key, d.UserId }).IsUnique();
builder.HasIndex(d => new { d.Key, d.UserId, d.Played });
builder.HasIndex(d => new { d.Key, d.UserId, d.PlaybackPositionTicks });
builder.HasIndex(d => new { d.Key, d.UserId, d.IsFavorite });
builder.HasIndex(d => new { d.Key, d.UserId, d.LastPlayedDate });
}
}