You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1141 lines
59 KiB
1141 lines
59 KiB
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated from a template.
|
|
//
|
|
// Manual changes to this file may cause unexpected behavior in your application.
|
|
// Manual changes to this file will be overwritten if the code is regenerated.
|
|
//
|
|
// Produced by Entity Framework Visual Editor
|
|
// https://github.com/msawczyn/EFDesigner
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Jellyfin.Data.DbContexts
|
|
{
|
|
/// <inheritdoc/>
|
|
public partial class Jellyfin : DbContext
|
|
{
|
|
#region DbSets
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Artwork> Artwork { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Book> Books { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.BookMetadata> BookMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Chapter> Chapters { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Collection> Collections { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.CollectionItem> CollectionItems { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Company> Companies { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.CompanyMetadata> CompanyMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.CustomItem> CustomItems { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.CustomItemMetadata> CustomItemMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Episode> Episodes { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.EpisodeMetadata> EpisodeMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Genre> Genres { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Group> Groups { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Library> Libraries { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.LibraryItem> LibraryItems { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.LibraryRoot> LibraryRoot { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.MediaFile> MediaFiles { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.MediaFileStream> MediaFileStream { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Metadata> Metadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.MetadataProvider> MetadataProviders { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.MetadataProviderId> MetadataProviderIds { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Movie> Movies { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.MovieMetadata> MovieMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.MusicAlbum> MusicAlbums { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.MusicAlbumMetadata> MusicAlbumMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Permission> Permissions { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Person> People { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.PersonRole> PersonRoles { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Photo> Photo { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.PhotoMetadata> PhotoMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Preference> Preferences { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.ProviderMapping> ProviderMappings { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Rating> Ratings { get; set; }
|
|
|
|
/// <summary>
|
|
/// Repository for global::Jellyfin.Data.Entities.RatingSource - This is the entity to
|
|
/// store review ratings, not age ratings
|
|
/// </summary>
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.RatingSource> RatingSources { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Release> Releases { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Season> Seasons { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.SeasonMetadata> SeasonMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Series> Series { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.SeriesMetadata> SeriesMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.Track> Tracks { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.TrackMetadata> TrackMetadata { get; set; }
|
|
public virtual Microsoft.EntityFrameworkCore.DbSet<global::Jellyfin.Data.Entities.User> Users { get; set; }
|
|
#endregion DbSets
|
|
|
|
/// <summary>
|
|
/// Default connection string
|
|
/// </summary>
|
|
public static string ConnectionString { get; set; } = @"Data Source=jellyfin.db";
|
|
|
|
/// <inheritdoc />
|
|
public Jellyfin(DbContextOptions<Jellyfin> options) : base(options)
|
|
{
|
|
}
|
|
|
|
partial void CustomInit(DbContextOptionsBuilder optionsBuilder);
|
|
|
|
/// <inheritdoc />
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
CustomInit(optionsBuilder);
|
|
}
|
|
|
|
partial void OnModelCreatingImpl(ModelBuilder modelBuilder);
|
|
partial void OnModelCreatedImpl(ModelBuilder modelBuilder);
|
|
|
|
/// <inheritdoc />
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
OnModelCreatingImpl(modelBuilder);
|
|
|
|
modelBuilder.HasDefaultSchema("jellyfin");
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Artwork>()
|
|
.ToTable("Artwork")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Artwork>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Artwork>()
|
|
.Property(t => t.Path)
|
|
.HasMaxLength(65535)
|
|
.IsRequired()
|
|
.HasField("_Path")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Artwork>()
|
|
.Property(t => t.Kind)
|
|
.IsRequired()
|
|
.HasField("_Kind")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Artwork>().HasIndex(t => t.Kind);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Artwork>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Book>()
|
|
.HasMany(x => x.BookMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("BookMetadata_BookMetadata_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Book>()
|
|
.HasMany(x => x.Releases)
|
|
.WithOne()
|
|
.HasForeignKey("Release_Releases_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.BookMetadata>()
|
|
.Property(t => t.ISBN)
|
|
.HasField("_ISBN")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.BookMetadata>()
|
|
.HasMany(x => x.Publishers)
|
|
.WithOne()
|
|
.HasForeignKey("Company_Publishers_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Chapter>()
|
|
.ToTable("Chapter")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Chapter>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Chapter>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Chapter>()
|
|
.Property(t => t.Language)
|
|
.HasMaxLength(3)
|
|
.IsRequired()
|
|
.HasField("_Language")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Chapter>()
|
|
.Property(t => t.TimeStart)
|
|
.IsRequired()
|
|
.HasField("_TimeStart")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Chapter>()
|
|
.Property(t => t.TimeEnd)
|
|
.HasField("_TimeEnd")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Chapter>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Collection>()
|
|
.ToTable("Collection")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Collection>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Collection>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Collection>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Collection>()
|
|
.HasMany(x => x.CollectionItem)
|
|
.WithOne()
|
|
.HasForeignKey("CollectionItem_CollectionItem_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CollectionItem>()
|
|
.ToTable("CollectionItem")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CollectionItem>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CollectionItem>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CollectionItem>()
|
|
.HasOne(x => x.LibraryItem)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.CollectionItem>("LibraryItem_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CollectionItem>()
|
|
.HasOne(x => x.Next)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.CollectionItem>("CollectionItem_Next_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CollectionItem>()
|
|
.HasOne(x => x.Previous)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.CollectionItem>("CollectionItem_Previous_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Company>()
|
|
.ToTable("Company")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Company>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Company>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Company>()
|
|
.HasMany(x => x.CompanyMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("CompanyMetadata_CompanyMetadata_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Company>()
|
|
.HasOne(x => x.Parent)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.Company>("Company_Parent_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CompanyMetadata>()
|
|
.Property(t => t.Description)
|
|
.HasMaxLength(65535)
|
|
.HasField("_Description")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CompanyMetadata>()
|
|
.Property(t => t.Headquarters)
|
|
.HasMaxLength(255)
|
|
.HasField("_Headquarters")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CompanyMetadata>()
|
|
.Property(t => t.Country)
|
|
.HasMaxLength(2)
|
|
.HasField("_Country")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CompanyMetadata>()
|
|
.Property(t => t.Homepage)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Homepage")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CustomItem>()
|
|
.HasMany(x => x.CustomItemMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("CustomItemMetadata_CustomItemMetadata_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.CustomItem>()
|
|
.HasMany(x => x.Releases)
|
|
.WithOne()
|
|
.HasForeignKey("Release_Releases_Id")
|
|
.IsRequired();
|
|
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Episode>()
|
|
.Property(t => t.EpisodeNumber)
|
|
.HasField("_EpisodeNumber")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Episode>()
|
|
.HasMany(x => x.Releases)
|
|
.WithOne()
|
|
.HasForeignKey("Release_Releases_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Episode>()
|
|
.HasMany(x => x.EpisodeMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("EpisodeMetadata_EpisodeMetadata_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.EpisodeMetadata>()
|
|
.Property(t => t.Outline)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Outline")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.EpisodeMetadata>()
|
|
.Property(t => t.Plot)
|
|
.HasMaxLength(65535)
|
|
.HasField("_Plot")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.EpisodeMetadata>()
|
|
.Property(t => t.Tagline)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Tagline")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Genre>()
|
|
.ToTable("Genre")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Genre>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Genre>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(255)
|
|
.IsRequired()
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Genre>().HasIndex(t => t.Name)
|
|
.IsUnique();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Genre>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Group>()
|
|
.ToTable("Groups")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Group>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Group>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(255)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Group>().Property<byte[]>("Timestamp").IsConcurrencyToken();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Group>()
|
|
.HasMany(x => x.GroupPermissions)
|
|
.WithOne()
|
|
.HasForeignKey("Permission_GroupPermissions_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Group>()
|
|
.HasMany(x => x.ProviderMappings)
|
|
.WithOne()
|
|
.HasForeignKey("ProviderMapping_ProviderMappings_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Group>()
|
|
.HasMany(x => x.Preferences)
|
|
.WithOne()
|
|
.HasForeignKey("Preference_Preferences_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Library>()
|
|
.ToTable("Library")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Library>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Library>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(1024)
|
|
.IsRequired()
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Library>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryItem>()
|
|
.ToTable("LibraryItem")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryItem>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryItem>()
|
|
.Property(t => t.UrlId)
|
|
.IsRequired()
|
|
.HasField("_UrlId")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryItem>().HasIndex(t => t.UrlId)
|
|
.IsUnique();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryItem>()
|
|
.Property(t => t.DateAdded)
|
|
.IsRequired()
|
|
.HasField("_DateAdded")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryItem>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryItem>()
|
|
.HasOne(x => x.LibraryRoot)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.LibraryItem>("LibraryRoot_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryRoot>()
|
|
.ToTable("LibraryRoot")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryRoot>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryRoot>()
|
|
.Property(t => t.Path)
|
|
.HasMaxLength(65535)
|
|
.IsRequired()
|
|
.HasField("_Path")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryRoot>()
|
|
.Property(t => t.NetworkPath)
|
|
.HasMaxLength(65535)
|
|
.HasField("_NetworkPath")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryRoot>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.LibraryRoot>()
|
|
.HasOne(x => x.Library)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.LibraryRoot>("Library_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFile>()
|
|
.ToTable("MediaFile")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFile>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFile>()
|
|
.Property(t => t.Path)
|
|
.HasMaxLength(65535)
|
|
.IsRequired()
|
|
.HasField("_Path")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFile>()
|
|
.Property(t => t.Kind)
|
|
.IsRequired()
|
|
.HasField("_Kind")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFile>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFile>()
|
|
.HasMany(x => x.MediaFileStreams)
|
|
.WithOne()
|
|
.HasForeignKey("MediaFileStream_MediaFileStreams_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFileStream>()
|
|
.ToTable("MediaFileStream")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFileStream>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFileStream>()
|
|
.Property(t => t.StreamNumber)
|
|
.IsRequired()
|
|
.HasField("_StreamNumber")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MediaFileStream>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.ToTable("Metadata")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.Title)
|
|
.HasMaxLength(1024)
|
|
.IsRequired()
|
|
.HasField("_Title")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.OriginalTitle)
|
|
.HasMaxLength(1024)
|
|
.HasField("_OriginalTitle")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.SortTitle)
|
|
.HasMaxLength(1024)
|
|
.HasField("_SortTitle")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.Language)
|
|
.HasMaxLength(3)
|
|
.IsRequired()
|
|
.HasField("_Language")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.ReleaseDate)
|
|
.HasField("_ReleaseDate")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.DateAdded)
|
|
.IsRequired()
|
|
.HasField("_DateAdded")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.DateModified)
|
|
.IsRequired()
|
|
.HasField("_DateModified")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.HasMany(x => x.PersonRoles)
|
|
.WithOne()
|
|
.HasForeignKey("PersonRole_PersonRoles_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.HasMany(x => x.Genres)
|
|
.WithOne()
|
|
.HasForeignKey("Genre_Genres_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.HasMany(x => x.Artwork)
|
|
.WithOne()
|
|
.HasForeignKey("Artwork_Artwork_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.HasMany(x => x.Ratings)
|
|
.WithOne()
|
|
.HasForeignKey("Rating_Ratings_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Metadata>()
|
|
.HasMany(x => x.Sources)
|
|
.WithOne()
|
|
.HasForeignKey("MetadataProviderId_Sources_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProvider>()
|
|
.ToTable("MetadataProvider")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProvider>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProvider>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(1024)
|
|
.IsRequired()
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProvider>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProviderId>()
|
|
.ToTable("MetadataProviderId")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProviderId>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProviderId>()
|
|
.Property(t => t.ProviderId)
|
|
.HasMaxLength(255)
|
|
.IsRequired()
|
|
.HasField("_ProviderId")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProviderId>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MetadataProviderId>()
|
|
.HasOne(x => x.MetadataProvider)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.MetadataProviderId>("MetadataProvider_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Movie>()
|
|
.HasMany(x => x.Releases)
|
|
.WithOne()
|
|
.HasForeignKey("Release_Releases_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Movie>()
|
|
.HasMany(x => x.MovieMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("MovieMetadata_MovieMetadata_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MovieMetadata>()
|
|
.Property(t => t.Outline)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Outline")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MovieMetadata>()
|
|
.Property(t => t.Plot)
|
|
.HasMaxLength(65535)
|
|
.HasField("_Plot")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MovieMetadata>()
|
|
.Property(t => t.Tagline)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Tagline")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MovieMetadata>()
|
|
.Property(t => t.Country)
|
|
.HasMaxLength(2)
|
|
.HasField("_Country")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MovieMetadata>()
|
|
.HasMany(x => x.Studios)
|
|
.WithOne()
|
|
.HasForeignKey("Company_Studios_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MusicAlbum>()
|
|
.HasMany(x => x.MusicAlbumMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("MusicAlbumMetadata_MusicAlbumMetadata_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MusicAlbum>()
|
|
.HasMany(x => x.Tracks)
|
|
.WithOne()
|
|
.HasForeignKey("Track_Tracks_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MusicAlbumMetadata>()
|
|
.Property(t => t.Barcode)
|
|
.HasMaxLength(255)
|
|
.HasField("_Barcode")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MusicAlbumMetadata>()
|
|
.Property(t => t.LabelNumber)
|
|
.HasMaxLength(255)
|
|
.HasField("_LabelNumber")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MusicAlbumMetadata>()
|
|
.Property(t => t.Country)
|
|
.HasMaxLength(2)
|
|
.HasField("_Country")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.MusicAlbumMetadata>()
|
|
.HasMany(x => x.Labels)
|
|
.WithOne()
|
|
.HasForeignKey("Company_Labels_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Permission>()
|
|
.ToTable("Permissions")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Permission>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Permission>()
|
|
.Property(t => t.Kind)
|
|
.IsRequired()
|
|
.HasField("_Kind")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Permission>()
|
|
.Property(t => t.Value)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Permission>().Property<byte[]>("Timestamp").IsConcurrencyToken();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.ToTable("Person")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.Property(t => t.UrlId)
|
|
.IsRequired()
|
|
.HasField("_UrlId")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(1024)
|
|
.IsRequired()
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.Property(t => t.SourceId)
|
|
.HasMaxLength(255)
|
|
.HasField("_SourceId")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.Property(t => t.DateAdded)
|
|
.IsRequired()
|
|
.HasField("_DateAdded")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.Property(t => t.DateModified)
|
|
.IsRequired()
|
|
.HasField("_DateModified")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Person>()
|
|
.HasMany(x => x.Sources)
|
|
.WithOne()
|
|
.HasForeignKey("MetadataProviderId_Sources_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.ToTable("PersonRole")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.Property(t => t.Role)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Role")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.Property(t => t.Type)
|
|
.IsRequired()
|
|
.HasField("_Type")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.HasOne(x => x.Person)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.PersonRole>("Person_Id")
|
|
.IsRequired()
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.HasOne(x => x.Artwork)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.PersonRole>("Artwork_Artwork_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.PersonRole>()
|
|
.HasMany(x => x.Sources)
|
|
.WithOne()
|
|
.HasForeignKey("MetadataProviderId_Sources_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Photo>()
|
|
.HasMany(x => x.PhotoMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("PhotoMetadata_PhotoMetadata_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Photo>()
|
|
.HasMany(x => x.Releases)
|
|
.WithOne()
|
|
.HasForeignKey("Release_Releases_Id")
|
|
.IsRequired();
|
|
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Preference>()
|
|
.ToTable("Preferences")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Preference>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Preference>()
|
|
.Property(t => t.Kind)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Preference>()
|
|
.Property(t => t.Value)
|
|
.HasMaxLength(65535)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Preference>().Property<byte[]>("Timestamp").IsConcurrencyToken();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.ProviderMapping>()
|
|
.ToTable("ProviderMappings")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.ProviderMapping>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.ProviderMapping>()
|
|
.Property(t => t.ProviderName)
|
|
.HasMaxLength(255)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.ProviderMapping>()
|
|
.Property(t => t.ProviderSecrets)
|
|
.HasMaxLength(65535)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.ProviderMapping>()
|
|
.Property(t => t.ProviderData)
|
|
.HasMaxLength(65535)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.ProviderMapping>().Property<byte[]>("Timestamp").IsConcurrencyToken();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Rating>()
|
|
.ToTable("Rating")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Rating>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Rating>()
|
|
.Property(t => t.Value)
|
|
.IsRequired()
|
|
.HasField("_Value")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Rating>()
|
|
.Property(t => t.Votes)
|
|
.HasField("_Votes")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Rating>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Rating>()
|
|
.HasOne(x => x.RatingType)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.Rating>("RatingSource_RatingType_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.RatingSource>()
|
|
.ToTable("RatingType")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.RatingSource>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.RatingSource>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.RatingSource>()
|
|
.Property(t => t.MaximumValue)
|
|
.IsRequired()
|
|
.HasField("_MaximumValue")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.RatingSource>()
|
|
.Property(t => t.MinimumValue)
|
|
.IsRequired()
|
|
.HasField("_MinimumValue")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.RatingSource>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.RatingSource>()
|
|
.HasOne(x => x.Source)
|
|
.WithOne()
|
|
.HasForeignKey<global::Jellyfin.Data.Entities.RatingSource>("MetadataProviderId_Source_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Release>()
|
|
.ToTable("Release")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Release>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.HasField("_Id")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Release>()
|
|
.Property(t => t.Name)
|
|
.HasMaxLength(1024)
|
|
.IsRequired()
|
|
.HasField("_Name")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Release>()
|
|
.Property(t => t.Timestamp)
|
|
.IsRequired()
|
|
.HasField("_Timestamp")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property)
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Release>()
|
|
.HasMany(x => x.MediaFiles)
|
|
.WithOne()
|
|
.HasForeignKey("MediaFile_MediaFiles_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Release>()
|
|
.HasMany(x => x.Chapters)
|
|
.WithOne()
|
|
.HasForeignKey("Chapter_Chapters_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Season>()
|
|
.Property(t => t.SeasonNumber)
|
|
.HasField("_SeasonNumber")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Season>()
|
|
.HasMany(x => x.SeasonMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("SeasonMetadata_SeasonMetadata_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Season>()
|
|
.HasMany(x => x.Episodes)
|
|
.WithOne()
|
|
.HasForeignKey("Episode_Episodes_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.SeasonMetadata>()
|
|
.Property(t => t.Outline)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Outline")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Series>()
|
|
.Property(t => t.AirsDayOfWeek)
|
|
.HasField("_AirsDayOfWeek")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Series>()
|
|
.Property(t => t.AirsTime)
|
|
.HasField("_AirsTime")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Series>()
|
|
.Property(t => t.FirstAired)
|
|
.HasField("_FirstAired")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Series>()
|
|
.HasMany(x => x.SeriesMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("SeriesMetadata_SeriesMetadata_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Series>()
|
|
.HasMany(x => x.Seasons)
|
|
.WithOne()
|
|
.HasForeignKey("Season_Seasons_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.SeriesMetadata>()
|
|
.Property(t => t.Outline)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Outline")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.SeriesMetadata>()
|
|
.Property(t => t.Plot)
|
|
.HasMaxLength(65535)
|
|
.HasField("_Plot")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.SeriesMetadata>()
|
|
.Property(t => t.Tagline)
|
|
.HasMaxLength(1024)
|
|
.HasField("_Tagline")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.SeriesMetadata>()
|
|
.Property(t => t.Country)
|
|
.HasMaxLength(2)
|
|
.HasField("_Country")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.SeriesMetadata>()
|
|
.HasMany(x => x.Networks)
|
|
.WithOne()
|
|
.HasForeignKey("Company_Networks_Id")
|
|
.IsRequired();
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Track>()
|
|
.Property(t => t.TrackNumber)
|
|
.HasField("_TrackNumber")
|
|
.UsePropertyAccessMode(PropertyAccessMode.Property);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Track>()
|
|
.HasMany(x => x.Releases)
|
|
.WithOne()
|
|
.HasForeignKey("Release_Releases_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.Track>()
|
|
.HasMany(x => x.TrackMetadata)
|
|
.WithOne()
|
|
.HasForeignKey("TrackMetadata_TrackMetadata_Id")
|
|
.IsRequired();
|
|
|
|
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.ToTable("Users")
|
|
.HasKey(t => t.Id);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.Id)
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.LastLoginTimestamp)
|
|
.IsRequired()
|
|
.IsRowVersion();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.Username)
|
|
.HasMaxLength(255)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.Password)
|
|
.HasMaxLength(65535);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.MustUpdatePassword)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.AudioLanguagePreference)
|
|
.HasMaxLength(255)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.AuthenticationProviderId)
|
|
.HasMaxLength(255)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.GroupedFolders)
|
|
.HasMaxLength(65535);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.InvalidLoginAttemptCount)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.LatestItemExcludes)
|
|
.HasMaxLength(65535);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.MyMediaExcludes)
|
|
.HasMaxLength(65535);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.OrderedViews)
|
|
.HasMaxLength(65535);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.SubtitleMode)
|
|
.HasMaxLength(255)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.PlayDefaultAudioTrack)
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.Property(t => t.SubtitleLanguagePrefernce)
|
|
.HasMaxLength(255);
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.HasMany(x => x.Groups)
|
|
.WithOne()
|
|
.HasForeignKey("Group_Groups_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.HasMany(x => x.Permissions)
|
|
.WithOne()
|
|
.HasForeignKey("Permission_Permissions_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.HasMany(x => x.ProviderMappings)
|
|
.WithOne()
|
|
.HasForeignKey("ProviderMapping_ProviderMappings_Id")
|
|
.IsRequired();
|
|
modelBuilder.Entity<global::Jellyfin.Data.Entities.User>()
|
|
.HasMany(x => x.Preferences)
|
|
.WithOne()
|
|
.HasForeignKey("Preference_Preferences_Id")
|
|
.IsRequired();
|
|
|
|
OnModelCreatedImpl(modelBuilder);
|
|
}
|
|
}
|
|
}
|