< Summary - Jellyfin

Line coverage
98%
Covered lines: 1756
Uncovered lines: 26
Coverable lines: 1782
Total lines: 1897
Line coverage: 98.5%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 8/2/2026 - 12:17:28 AM Line coverage: 98.5% (1756/1782) Total lines: 1897

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: Up(...)100%11100%
File 1: Down(...)100%210%
File 2: BuildTargetModel(...)100%11100%

File(s)

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20260723111547_AllowDuplicatePlaylistChildren.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Jellyfin.Database.Providers.Sqlite.Migrations
 6{
 7    /// <inheritdoc />
 8    public partial class AllowDuplicatePlaylistChildren : Migration
 9    {
 10        /// <inheritdoc />
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 13            // Rows that predate the composite (ParentId, SortOrder) primary key stored a null SortOrder
 14            // (e.g. BoxSet and Collection children). Assign each such row a stable 0-based position within
 15            // its parent so the rows stay unique once SortOrder becomes part of the primary key; otherwise
 16            // they would all collapse to the column default (0) and collide during the table rebuild.
 2717            migrationBuilder.Sql(
 2718                @"UPDATE ""LinkedChildren""
 2719                  SET ""SortOrder"" = (
 2720                      SELECT COUNT(*)
 2721                      FROM ""LinkedChildren"" AS lc2
 2722                      WHERE lc2.""ParentId"" = ""LinkedChildren"".""ParentId""
 2723                        AND lc2.""rowid"" < ""LinkedChildren"".""rowid""
 2724                  )
 2725                  WHERE ""SortOrder"" IS NULL;");
 26
 2727            migrationBuilder.DropPrimaryKey(
 2728                name: "PK_LinkedChildren",
 2729                table: "LinkedChildren");
 30
 2731            migrationBuilder.DropIndex(
 2732                name: "IX_LinkedChildren_ParentId_SortOrder",
 2733                table: "LinkedChildren");
 34
 2735            migrationBuilder.AlterColumn<int>(
 2736                name: "SortOrder",
 2737                table: "LinkedChildren",
 2738                type: "INTEGER",
 2739                nullable: false,
 2740                defaultValue: 0,
 2741                oldClrType: typeof(int),
 2742                oldType: "INTEGER",
 2743                oldNullable: true);
 44
 2745            migrationBuilder.AddPrimaryKey(
 2746                name: "PK_LinkedChildren",
 2747                table: "LinkedChildren",
 2748                columns: new[] { "ParentId", "SortOrder" });
 2749        }
 50
 51        /// <inheritdoc />
 52        protected override void Down(MigrationBuilder migrationBuilder)
 53        {
 54            // The (ParentId, ChildId) primary key cannot represent the same child more than once per
 55            // parent. Drop any duplicate entries (keeping the first by SortOrder) that may have been
 56            // created while duplicates were allowed, so the old key can be restored. This is lossy by
 57            // nature — duplicate playlist entries cannot survive a downgrade.
 058            migrationBuilder.Sql(
 059                @"DELETE FROM ""LinkedChildren""
 060                  WHERE ""rowid"" NOT IN (
 061                      SELECT MIN(""rowid"")
 062                      FROM ""LinkedChildren""
 063                      GROUP BY ""ParentId"", ""ChildId""
 064                  );");
 65
 066            migrationBuilder.DropPrimaryKey(
 067                name: "PK_LinkedChildren",
 068                table: "LinkedChildren");
 69
 070            migrationBuilder.AlterColumn<int>(
 071                name: "SortOrder",
 072                table: "LinkedChildren",
 073                type: "INTEGER",
 074                nullable: true,
 075                oldClrType: typeof(int),
 076                oldType: "INTEGER");
 77
 078            migrationBuilder.AddPrimaryKey(
 079                name: "PK_LinkedChildren",
 080                table: "LinkedChildren",
 081                columns: new[] { "ParentId", "ChildId" });
 82
 083            migrationBuilder.CreateIndex(
 084                name: "IX_LinkedChildren_ParentId_SortOrder",
 085                table: "LinkedChildren",
 086                columns: new[] { "ParentId", "SortOrder" });
 087        }
 88    }
 89}

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20260723111547_AllowDuplicatePlaylistChildren.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Jellyfin.Database.Implementations;
 4using Microsoft.EntityFrameworkCore;
 5using Microsoft.EntityFrameworkCore.Infrastructure;
 6using Microsoft.EntityFrameworkCore.Migrations;
 7using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 8
 9#nullable disable
 10
 11namespace Jellyfin.Database.Providers.Sqlite.Migrations
 12{
 13    [DbContext(typeof(JellyfinDbContext))]
 14    [Migration("20260723111547_AllowDuplicatePlaylistChildren")]
 15    partial class AllowDuplicatePlaylistChildren
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 2721            modelBuilder.HasAnnotation("ProductVersion", "10.0.10");
 22
 2723            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 2724                {
 2725                    b.Property<int>("Id")
 2726                        .ValueGeneratedOnAdd()
 2727                        .HasColumnType("INTEGER");
 2728
 2729                    b.Property<int>("DayOfWeek")
 2730                        .HasColumnType("INTEGER");
 2731
 2732                    b.Property<double>("EndHour")
 2733                        .HasColumnType("REAL");
 2734
 2735                    b.Property<double>("StartHour")
 2736                        .HasColumnType("REAL");
 2737
 2738                    b.Property<Guid>("UserId")
 2739                        .HasColumnType("TEXT");
 2740
 2741                    b.HasKey("Id");
 2742
 2743                    b.HasIndex("UserId");
 2744
 2745                    b.ToTable("AccessSchedules");
 2746
 2747                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 2748                });
 49
 2750            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ActivityLog", b =>
 2751                {
 2752                    b.Property<int>("Id")
 2753                        .ValueGeneratedOnAdd()
 2754                        .HasColumnType("INTEGER");
 2755
 2756                    b.Property<DateTime>("DateCreated")
 2757                        .HasColumnType("TEXT");
 2758
 2759                    b.Property<string>("ItemId")
 2760                        .HasMaxLength(256)
 2761                        .HasColumnType("TEXT");
 2762
 2763                    b.Property<int>("LogSeverity")
 2764                        .HasColumnType("INTEGER");
 2765
 2766                    b.Property<string>("Name")
 2767                        .IsRequired()
 2768                        .HasMaxLength(512)
 2769                        .HasColumnType("TEXT");
 2770
 2771                    b.Property<string>("Overview")
 2772                        .HasMaxLength(512)
 2773                        .HasColumnType("TEXT");
 2774
 2775                    b.Property<uint>("RowVersion")
 2776                        .IsConcurrencyToken()
 2777                        .HasColumnType("INTEGER");
 2778
 2779                    b.Property<string>("ShortOverview")
 2780                        .HasMaxLength(512)
 2781                        .HasColumnType("TEXT");
 2782
 2783                    b.Property<string>("Type")
 2784                        .IsRequired()
 2785                        .HasMaxLength(256)
 2786                        .HasColumnType("TEXT");
 2787
 2788                    b.Property<Guid>("UserId")
 2789                        .HasColumnType("TEXT");
 2790
 2791                    b.HasKey("Id");
 2792
 2793                    b.HasIndex("DateCreated");
 2794
 2795                    b.ToTable("ActivityLogs");
 2796
 2797                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 2798                });
 99
 27100            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 27101                {
 27102                    b.Property<Guid>("ItemId")
 27103                        .HasColumnType("TEXT");
 27104
 27105                    b.Property<Guid>("ParentItemId")
 27106                        .HasColumnType("TEXT");
 27107
 27108                    b.HasKey("ItemId", "ParentItemId");
 27109
 27110                    b.HasIndex("ParentItemId");
 27111
 27112                    b.ToTable("AncestorIds");
 27113
 27114                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27115                });
 116
 27117            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 27118                {
 27119                    b.Property<Guid>("ItemId")
 27120                        .HasColumnType("TEXT");
 27121
 27122                    b.Property<int>("Index")
 27123                        .HasColumnType("INTEGER");
 27124
 27125                    b.Property<string>("Codec")
 27126                        .HasColumnType("TEXT");
 27127
 27128                    b.Property<string>("CodecTag")
 27129                        .HasColumnType("TEXT");
 27130
 27131                    b.Property<string>("Comment")
 27132                        .HasColumnType("TEXT");
 27133
 27134                    b.Property<string>("Filename")
 27135                        .HasColumnType("TEXT");
 27136
 27137                    b.Property<string>("MimeType")
 27138                        .HasColumnType("TEXT");
 27139
 27140                    b.HasKey("ItemId", "Index");
 27141
 27142                    b.ToTable("AttachmentStreamInfos");
 27143
 27144                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27145                });
 146
 27147            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 27148                {
 27149                    b.Property<Guid>("Id")
 27150                        .ValueGeneratedOnAdd()
 27151                        .HasColumnType("TEXT");
 27152
 27153                    b.Property<string>("Album")
 27154                        .HasColumnType("TEXT");
 27155
 27156                    b.Property<string>("AlbumArtists")
 27157                        .HasColumnType("TEXT");
 27158
 27159                    b.Property<string>("Artists")
 27160                        .HasColumnType("TEXT");
 27161
 27162                    b.Property<int?>("Audio")
 27163                        .HasColumnType("INTEGER");
 27164
 27165                    b.Property<Guid?>("ChannelId")
 27166                        .HasColumnType("TEXT");
 27167
 27168                    b.Property<string>("CleanName")
 27169                        .HasColumnType("TEXT");
 27170
 27171                    b.Property<float?>("CommunityRating")
 27172                        .HasColumnType("REAL");
 27173
 27174                    b.Property<float?>("CriticRating")
 27175                        .HasColumnType("REAL");
 27176
 27177                    b.Property<string>("CustomRating")
 27178                        .HasColumnType("TEXT");
 27179
 27180                    b.Property<string>("Data")
 27181                        .HasColumnType("TEXT");
 27182
 27183                    b.Property<DateTime?>("DateCreated")
 27184                        .HasColumnType("TEXT");
 27185
 27186                    b.Property<DateTime?>("DateLastMediaAdded")
 27187                        .HasColumnType("TEXT");
 27188
 27189                    b.Property<DateTime?>("DateLastRefreshed")
 27190                        .HasColumnType("TEXT");
 27191
 27192                    b.Property<DateTime?>("DateLastSaved")
 27193                        .HasColumnType("TEXT");
 27194
 27195                    b.Property<DateTime?>("DateModified")
 27196                        .HasColumnType("TEXT");
 27197
 27198                    b.Property<DateTime?>("EndDate")
 27199                        .HasColumnType("TEXT");
 27200
 27201                    b.Property<string>("EpisodeTitle")
 27202                        .HasColumnType("TEXT");
 27203
 27204                    b.Property<string>("ExternalId")
 27205                        .HasColumnType("TEXT");
 27206
 27207                    b.Property<string>("ExternalSeriesId")
 27208                        .HasColumnType("TEXT");
 27209
 27210                    b.Property<string>("ExternalServiceId")
 27211                        .HasColumnType("TEXT");
 27212
 27213                    b.Property<int?>("ExtraType")
 27214                        .HasColumnType("INTEGER");
 27215
 27216                    b.Property<string>("ForcedSortName")
 27217                        .HasColumnType("TEXT");
 27218
 27219                    b.Property<string>("Genres")
 27220                        .HasColumnType("TEXT");
 27221
 27222                    b.Property<int?>("Height")
 27223                        .HasColumnType("INTEGER");
 27224
 27225                    b.Property<int?>("IndexNumber")
 27226                        .HasColumnType("INTEGER");
 27227
 27228                    b.Property<int?>("InheritedParentalRatingSubValue")
 27229                        .HasColumnType("INTEGER");
 27230
 27231                    b.Property<int?>("InheritedParentalRatingValue")
 27232                        .HasColumnType("INTEGER");
 27233
 27234                    b.Property<bool>("IsFolder")
 27235                        .HasColumnType("INTEGER");
 27236
 27237                    b.Property<bool>("IsInMixedFolder")
 27238                        .HasColumnType("INTEGER");
 27239
 27240                    b.Property<bool>("IsLocked")
 27241                        .HasColumnType("INTEGER");
 27242
 27243                    b.Property<bool>("IsMovie")
 27244                        .HasColumnType("INTEGER");
 27245
 27246                    b.Property<bool>("IsRepeat")
 27247                        .HasColumnType("INTEGER");
 27248
 27249                    b.Property<bool>("IsSeries")
 27250                        .HasColumnType("INTEGER");
 27251
 27252                    b.Property<bool>("IsVirtualItem")
 27253                        .HasColumnType("INTEGER");
 27254
 27255                    b.Property<float?>("LUFS")
 27256                        .HasColumnType("REAL");
 27257
 27258                    b.Property<string>("MediaType")
 27259                        .HasColumnType("TEXT");
 27260
 27261                    b.Property<string>("Name")
 27262                        .HasColumnType("TEXT");
 27263
 27264                    b.Property<float?>("NormalizationGain")
 27265                        .HasColumnType("REAL");
 27266
 27267                    b.Property<string>("OfficialRating")
 27268                        .HasColumnType("TEXT");
 27269
 27270                    b.Property<string>("OriginalLanguage")
 27271                        .HasColumnType("TEXT");
 27272
 27273                    b.Property<string>("OriginalTitle")
 27274                        .HasColumnType("TEXT");
 27275
 27276                    b.Property<string>("Overview")
 27277                        .HasColumnType("TEXT");
 27278
 27279                    b.Property<Guid?>("OwnerId")
 27280                        .HasColumnType("TEXT");
 27281
 27282                    b.Property<Guid?>("ParentId")
 27283                        .HasColumnType("TEXT");
 27284
 27285                    b.Property<int?>("ParentIndexNumber")
 27286                        .HasColumnType("INTEGER");
 27287
 27288                    b.Property<string>("Path")
 27289                        .HasColumnType("TEXT");
 27290
 27291                    b.Property<string>("PreferredMetadataCountryCode")
 27292                        .HasColumnType("TEXT");
 27293
 27294                    b.Property<string>("PreferredMetadataLanguage")
 27295                        .HasColumnType("TEXT");
 27296
 27297                    b.Property<DateTime?>("PremiereDate")
 27298                        .HasColumnType("TEXT");
 27299
 27300                    b.Property<string>("PresentationUniqueKey")
 27301                        .HasColumnType("TEXT");
 27302
 27303                    b.Property<Guid?>("PrimaryVersionId")
 27304                        .HasColumnType("TEXT");
 27305
 27306                    b.Property<string>("ProductionLocations")
 27307                        .HasColumnType("TEXT");
 27308
 27309                    b.Property<int?>("ProductionYear")
 27310                        .HasColumnType("INTEGER");
 27311
 27312                    b.Property<long?>("RunTimeTicks")
 27313                        .HasColumnType("INTEGER");
 27314
 27315                    b.Property<Guid?>("SeasonId")
 27316                        .HasColumnType("TEXT");
 27317
 27318                    b.Property<string>("SeasonName")
 27319                        .HasColumnType("TEXT");
 27320
 27321                    b.Property<Guid?>("SeriesId")
 27322                        .HasColumnType("TEXT");
 27323
 27324                    b.Property<string>("SeriesName")
 27325                        .HasColumnType("TEXT");
 27326
 27327                    b.Property<string>("SeriesPresentationUniqueKey")
 27328                        .HasColumnType("TEXT");
 27329
 27330                    b.Property<string>("ShowId")
 27331                        .HasColumnType("TEXT");
 27332
 27333                    b.Property<long?>("Size")
 27334                        .HasColumnType("INTEGER");
 27335
 27336                    b.Property<string>("SortName")
 27337                        .HasColumnType("TEXT");
 27338
 27339                    b.Property<DateTime?>("StartDate")
 27340                        .HasColumnType("TEXT");
 27341
 27342                    b.Property<string>("Studios")
 27343                        .HasColumnType("TEXT");
 27344
 27345                    b.Property<string>("Tagline")
 27346                        .HasColumnType("TEXT");
 27347
 27348                    b.Property<string>("Tags")
 27349                        .HasColumnType("TEXT");
 27350
 27351                    b.Property<Guid?>("TopParentId")
 27352                        .HasColumnType("TEXT");
 27353
 27354                    b.Property<int?>("TotalBitrate")
 27355                        .HasColumnType("INTEGER");
 27356
 27357                    b.Property<string>("Type")
 27358                        .IsRequired()
 27359                        .HasColumnType("TEXT");
 27360
 27361                    b.Property<string>("UnratedType")
 27362                        .HasColumnType("TEXT");
 27363
 27364                    b.Property<int?>("Width")
 27365                        .HasColumnType("INTEGER");
 27366
 27367                    b.HasKey("Id");
 27368
 27369                    b.HasIndex("Name");
 27370
 27371                    b.HasIndex("OwnerId");
 27372
 27373                    b.HasIndex("ParentId");
 27374
 27375                    b.HasIndex("Path");
 27376
 27377                    b.HasIndex("PresentationUniqueKey");
 27378
 27379                    b.HasIndex("SeasonId");
 27380
 27381                    b.HasIndex("SeriesId");
 27382
 27383                    b.HasIndex("SeriesName");
 27384
 27385                    b.HasIndex("ExtraType", "OwnerId");
 27386
 27387                    b.HasIndex("TopParentId", "Id");
 27388
 27389                    b.HasIndex("Type", "CleanName");
 27390
 27391                    b.HasIndex("TopParentId", "Type", "IsVirtualItem")
 27392                        .HasFilter("\"PrimaryVersionId\" IS NULL AND (\"OwnerId\" IS NULL OR \"ExtraType\" IS NOT NULL)"
 27393
 27394                    b.HasIndex("Type", "TopParentId", "Id");
 27395
 27396                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 27397
 27398                    b.HasIndex("Type", "TopParentId", "SortName");
 27399
 27400                    b.HasIndex("Type", "TopParentId", "StartDate");
 27401
 27402                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 27403
 27404                    b.HasIndex("TopParentId", "IsFolder", "IsVirtualItem", "DateCreated");
 27405
 27406                    b.HasIndex("TopParentId", "MediaType", "IsVirtualItem", "DateCreated");
 27407
 27408                    b.HasIndex("TopParentId", "Type", "IsVirtualItem", "DateCreated");
 27409
 27410                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 27411
 27412                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "ParentIndexNumber", "IndexNumber");
 27413
 27414                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 27415
 27416                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27417
 27418                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27419
 27420                    b.ToTable("BaseItems");
 27421
 27422                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27423
 27424                    b.HasData(
 27425                        new
 27426                        {
 27427                            Id = new Guid("00000000-0000-0000-0000-000000000001"),
 27428                            IsFolder = false,
 27429                            IsInMixedFolder = false,
 27430                            IsLocked = false,
 27431                            IsMovie = false,
 27432                            IsRepeat = false,
 27433                            IsSeries = false,
 27434                            IsVirtualItem = false,
 27435                            Name = "This is a placeholder item for UserData that has been detached from its original ite
 27436                            Type = "PLACEHOLDER"
 27437                        });
 27438                });
 439
 27440            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 27441                {
 27442                    b.Property<Guid>("Id")
 27443                        .ValueGeneratedOnAdd()
 27444                        .HasColumnType("TEXT");
 27445
 27446                    b.Property<byte[]>("Blurhash")
 27447                        .HasColumnType("BLOB");
 27448
 27449                    b.Property<DateTime?>("DateModified")
 27450                        .HasColumnType("TEXT");
 27451
 27452                    b.Property<int>("Height")
 27453                        .HasColumnType("INTEGER");
 27454
 27455                    b.Property<int>("ImageType")
 27456                        .HasColumnType("INTEGER");
 27457
 27458                    b.Property<Guid>("ItemId")
 27459                        .HasColumnType("TEXT");
 27460
 27461                    b.Property<string>("Path")
 27462                        .IsRequired()
 27463                        .HasColumnType("TEXT");
 27464
 27465                    b.Property<int>("Width")
 27466                        .HasColumnType("INTEGER");
 27467
 27468                    b.HasKey("Id");
 27469
 27470                    b.HasIndex("ItemId", "ImageType");
 27471
 27472                    b.ToTable("BaseItemImageInfos");
 27473
 27474                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27475                });
 476
 27477            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 27478                {
 27479                    b.Property<int>("Id")
 27480                        .HasColumnType("INTEGER");
 27481
 27482                    b.Property<Guid>("ItemId")
 27483                        .HasColumnType("TEXT");
 27484
 27485                    b.HasKey("Id", "ItemId");
 27486
 27487                    b.HasIndex("ItemId");
 27488
 27489                    b.ToTable("BaseItemMetadataFields");
 27490
 27491                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27492                });
 493
 27494            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 27495                {
 27496                    b.Property<Guid>("ItemId")
 27497                        .HasColumnType("TEXT");
 27498
 27499                    b.Property<string>("ProviderId")
 27500                        .HasColumnType("TEXT");
 27501
 27502                    b.Property<string>("ProviderValue")
 27503                        .IsRequired()
 27504                        .HasColumnType("TEXT");
 27505
 27506                    b.HasKey("ItemId", "ProviderId");
 27507
 27508                    b.HasIndex("ProviderId", "ItemId", "ProviderValue");
 27509
 27510                    b.ToTable("BaseItemProviders");
 27511
 27512                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27513                });
 514
 27515            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 27516                {
 27517                    b.Property<int>("Id")
 27518                        .HasColumnType("INTEGER");
 27519
 27520                    b.Property<Guid>("ItemId")
 27521                        .HasColumnType("TEXT");
 27522
 27523                    b.HasKey("Id", "ItemId");
 27524
 27525                    b.HasIndex("ItemId");
 27526
 27527                    b.ToTable("BaseItemTrailerTypes");
 27528
 27529                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27530                });
 531
 27532            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 27533                {
 27534                    b.Property<Guid>("ItemId")
 27535                        .HasColumnType("TEXT");
 27536
 27537                    b.Property<int>("ChapterIndex")
 27538                        .HasColumnType("INTEGER");
 27539
 27540                    b.Property<DateTime?>("ImageDateModified")
 27541                        .HasColumnType("TEXT");
 27542
 27543                    b.Property<string>("ImagePath")
 27544                        .HasColumnType("TEXT");
 27545
 27546                    b.Property<string>("Name")
 27547                        .HasColumnType("TEXT");
 27548
 27549                    b.Property<long>("StartPositionTicks")
 27550                        .HasColumnType("INTEGER");
 27551
 27552                    b.HasKey("ItemId", "ChapterIndex");
 27553
 27554                    b.ToTable("Chapters");
 27555
 27556                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27557                });
 558
 27559            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.CustomItemDisplayPreferences", b =>
 27560                {
 27561                    b.Property<int>("Id")
 27562                        .ValueGeneratedOnAdd()
 27563                        .HasColumnType("INTEGER");
 27564
 27565                    b.Property<string>("Client")
 27566                        .IsRequired()
 27567                        .HasMaxLength(32)
 27568                        .HasColumnType("TEXT");
 27569
 27570                    b.Property<Guid>("ItemId")
 27571                        .HasColumnType("TEXT");
 27572
 27573                    b.Property<string>("Key")
 27574                        .IsRequired()
 27575                        .HasColumnType("TEXT");
 27576
 27577                    b.Property<Guid>("UserId")
 27578                        .HasColumnType("TEXT");
 27579
 27580                    b.Property<string>("Value")
 27581                        .HasColumnType("TEXT");
 27582
 27583                    b.HasKey("Id");
 27584
 27585                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 27586                        .IsUnique();
 27587
 27588                    b.ToTable("CustomItemDisplayPreferences");
 27589
 27590                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27591                });
 592
 27593            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 27594                {
 27595                    b.Property<int>("Id")
 27596                        .ValueGeneratedOnAdd()
 27597                        .HasColumnType("INTEGER");
 27598
 27599                    b.Property<int>("ChromecastVersion")
 27600                        .HasColumnType("INTEGER");
 27601
 27602                    b.Property<string>("Client")
 27603                        .IsRequired()
 27604                        .HasMaxLength(32)
 27605                        .HasColumnType("TEXT");
 27606
 27607                    b.Property<string>("DashboardTheme")
 27608                        .HasMaxLength(32)
 27609                        .HasColumnType("TEXT");
 27610
 27611                    b.Property<bool>("EnableNextVideoInfoOverlay")
 27612                        .HasColumnType("INTEGER");
 27613
 27614                    b.Property<int?>("IndexBy")
 27615                        .HasColumnType("INTEGER");
 27616
 27617                    b.Property<Guid>("ItemId")
 27618                        .HasColumnType("TEXT");
 27619
 27620                    b.Property<int>("ScrollDirection")
 27621                        .HasColumnType("INTEGER");
 27622
 27623                    b.Property<bool>("ShowBackdrop")
 27624                        .HasColumnType("INTEGER");
 27625
 27626                    b.Property<bool>("ShowSidebar")
 27627                        .HasColumnType("INTEGER");
 27628
 27629                    b.Property<int>("SkipBackwardLength")
 27630                        .HasColumnType("INTEGER");
 27631
 27632                    b.Property<int>("SkipForwardLength")
 27633                        .HasColumnType("INTEGER");
 27634
 27635                    b.Property<string>("TvHome")
 27636                        .HasMaxLength(32)
 27637                        .HasColumnType("TEXT");
 27638
 27639                    b.Property<Guid>("UserId")
 27640                        .HasColumnType("TEXT");
 27641
 27642                    b.HasKey("Id");
 27643
 27644                    b.HasIndex("UserId", "ItemId", "Client")
 27645                        .IsUnique();
 27646
 27647                    b.ToTable("DisplayPreferences");
 27648
 27649                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27650                });
 651
 27652            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 27653                {
 27654                    b.Property<int>("Id")
 27655                        .ValueGeneratedOnAdd()
 27656                        .HasColumnType("INTEGER");
 27657
 27658                    b.Property<int>("DisplayPreferencesId")
 27659                        .HasColumnType("INTEGER");
 27660
 27661                    b.Property<int>("Order")
 27662                        .HasColumnType("INTEGER");
 27663
 27664                    b.Property<int>("Type")
 27665                        .HasColumnType("INTEGER");
 27666
 27667                    b.HasKey("Id");
 27668
 27669                    b.HasIndex("DisplayPreferencesId");
 27670
 27671                    b.ToTable("HomeSection");
 27672
 27673                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27674                });
 675
 27676            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 27677                {
 27678                    b.Property<int>("Id")
 27679                        .ValueGeneratedOnAdd()
 27680                        .HasColumnType("INTEGER");
 27681
 27682                    b.Property<DateTime>("LastModified")
 27683                        .HasColumnType("TEXT");
 27684
 27685                    b.Property<string>("Path")
 27686                        .IsRequired()
 27687                        .HasMaxLength(512)
 27688                        .HasColumnType("TEXT");
 27689
 27690                    b.Property<Guid?>("UserId")
 27691                        .HasColumnType("TEXT");
 27692
 27693                    b.HasKey("Id");
 27694
 27695                    b.HasIndex("UserId")
 27696                        .IsUnique();
 27697
 27698                    b.ToTable("ImageInfos");
 27699
 27700                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27701                });
 702
 27703            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 27704                {
 27705                    b.Property<int>("Id")
 27706                        .ValueGeneratedOnAdd()
 27707                        .HasColumnType("INTEGER");
 27708
 27709                    b.Property<string>("Client")
 27710                        .IsRequired()
 27711                        .HasMaxLength(32)
 27712                        .HasColumnType("TEXT");
 27713
 27714                    b.Property<int?>("IndexBy")
 27715                        .HasColumnType("INTEGER");
 27716
 27717                    b.Property<Guid>("ItemId")
 27718                        .HasColumnType("TEXT");
 27719
 27720                    b.Property<bool>("RememberIndexing")
 27721                        .HasColumnType("INTEGER");
 27722
 27723                    b.Property<bool>("RememberSorting")
 27724                        .HasColumnType("INTEGER");
 27725
 27726                    b.Property<string>("SortBy")
 27727                        .IsRequired()
 27728                        .HasMaxLength(64)
 27729                        .HasColumnType("TEXT");
 27730
 27731                    b.Property<int>("SortOrder")
 27732                        .HasColumnType("INTEGER");
 27733
 27734                    b.Property<Guid>("UserId")
 27735                        .HasColumnType("TEXT");
 27736
 27737                    b.Property<int>("ViewType")
 27738                        .HasColumnType("INTEGER");
 27739
 27740                    b.HasKey("Id");
 27741
 27742                    b.HasIndex("UserId");
 27743
 27744                    b.ToTable("ItemDisplayPreferences");
 27745
 27746                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27747                });
 748
 27749            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 27750                {
 27751                    b.Property<Guid>("ItemValueId")
 27752                        .ValueGeneratedOnAdd()
 27753                        .HasColumnType("TEXT");
 27754
 27755                    b.Property<string>("CleanValue")
 27756                        .IsRequired()
 27757                        .HasColumnType("TEXT");
 27758
 27759                    b.Property<int>("Type")
 27760                        .HasColumnType("INTEGER");
 27761
 27762                    b.Property<string>("Value")
 27763                        .IsRequired()
 27764                        .HasColumnType("TEXT");
 27765
 27766                    b.HasKey("ItemValueId");
 27767
 27768                    b.HasIndex("Type", "CleanValue");
 27769
 27770                    b.HasIndex("Type", "Value")
 27771                        .IsUnique();
 27772
 27773                    b.ToTable("ItemValues");
 27774
 27775                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27776                });
 777
 27778            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 27779                {
 27780                    b.Property<Guid>("ItemValueId")
 27781                        .HasColumnType("TEXT");
 27782
 27783                    b.Property<Guid>("ItemId")
 27784                        .HasColumnType("TEXT");
 27785
 27786                    b.HasKey("ItemValueId", "ItemId");
 27787
 27788                    b.HasIndex("ItemId");
 27789
 27790                    b.ToTable("ItemValuesMap");
 27791
 27792                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27793                });
 794
 27795            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 27796                {
 27797                    b.Property<Guid>("ItemId")
 27798                        .HasColumnType("TEXT");
 27799
 27800                    b.PrimitiveCollection<string>("KeyframeTicks")
 27801                        .HasColumnType("TEXT");
 27802
 27803                    b.Property<long>("TotalDuration")
 27804                        .HasColumnType("INTEGER");
 27805
 27806                    b.HasKey("ItemId");
 27807
 27808                    b.ToTable("KeyframeData");
 27809
 27810                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27811                });
 812
 27813            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 27814                {
 27815                    b.Property<Guid>("ParentId")
 27816                        .HasColumnType("TEXT");
 27817
 27818                    b.Property<int>("SortOrder")
 27819                        .HasColumnType("INTEGER");
 27820
 27821                    b.Property<Guid>("ChildId")
 27822                        .HasColumnType("TEXT");
 27823
 27824                    b.Property<int>("ChildType")
 27825                        .HasColumnType("INTEGER");
 27826
 27827                    b.HasKey("ParentId", "SortOrder");
 27828
 27829                    b.HasIndex("ChildId", "ChildType");
 27830
 27831                    b.HasIndex("ParentId", "ChildType");
 27832
 27833                    b.ToTable("LinkedChildren", (string)null);
 27834
 27835                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27836                });
 837
 27838            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaSegment", b =>
 27839                {
 27840                    b.Property<Guid>("Id")
 27841                        .ValueGeneratedOnAdd()
 27842                        .HasColumnType("TEXT");
 27843
 27844                    b.Property<long>("EndTicks")
 27845                        .HasColumnType("INTEGER");
 27846
 27847                    b.Property<Guid>("ItemId")
 27848                        .HasColumnType("TEXT");
 27849
 27850                    b.Property<string>("SegmentProviderId")
 27851                        .IsRequired()
 27852                        .HasColumnType("TEXT");
 27853
 27854                    b.Property<long>("StartTicks")
 27855                        .HasColumnType("INTEGER");
 27856
 27857                    b.Property<int>("Type")
 27858                        .HasColumnType("INTEGER");
 27859
 27860                    b.HasKey("Id");
 27861
 27862                    b.ToTable("MediaSegments");
 27863
 27864                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27865                });
 866
 27867            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 27868                {
 27869                    b.Property<Guid>("ItemId")
 27870                        .HasColumnType("TEXT");
 27871
 27872                    b.Property<int>("StreamIndex")
 27873                        .HasColumnType("INTEGER");
 27874
 27875                    b.Property<string>("AspectRatio")
 27876                        .HasColumnType("TEXT");
 27877
 27878                    b.Property<float?>("AverageFrameRate")
 27879                        .HasColumnType("REAL");
 27880
 27881                    b.Property<int?>("BitDepth")
 27882                        .HasColumnType("INTEGER");
 27883
 27884                    b.Property<int?>("BitRate")
 27885                        .HasColumnType("INTEGER");
 27886
 27887                    b.Property<int?>("BlPresentFlag")
 27888                        .HasColumnType("INTEGER");
 27889
 27890                    b.Property<string>("ChannelLayout")
 27891                        .HasColumnType("TEXT");
 27892
 27893                    b.Property<int?>("Channels")
 27894                        .HasColumnType("INTEGER");
 27895
 27896                    b.Property<string>("Codec")
 27897                        .HasColumnType("TEXT");
 27898
 27899                    b.Property<string>("CodecTag")
 27900                        .HasColumnType("TEXT");
 27901
 27902                    b.Property<string>("CodecTimeBase")
 27903                        .HasColumnType("TEXT");
 27904
 27905                    b.Property<string>("ColorPrimaries")
 27906                        .HasColumnType("TEXT");
 27907
 27908                    b.Property<string>("ColorSpace")
 27909                        .HasColumnType("TEXT");
 27910
 27911                    b.Property<string>("ColorTransfer")
 27912                        .HasColumnType("TEXT");
 27913
 27914                    b.Property<string>("Comment")
 27915                        .HasColumnType("TEXT");
 27916
 27917                    b.Property<int?>("DvBlSignalCompatibilityId")
 27918                        .HasColumnType("INTEGER");
 27919
 27920                    b.Property<int?>("DvLevel")
 27921                        .HasColumnType("INTEGER");
 27922
 27923                    b.Property<int?>("DvProfile")
 27924                        .HasColumnType("INTEGER");
 27925
 27926                    b.Property<int?>("DvVersionMajor")
 27927                        .HasColumnType("INTEGER");
 27928
 27929                    b.Property<int?>("DvVersionMinor")
 27930                        .HasColumnType("INTEGER");
 27931
 27932                    b.Property<int?>("ElPresentFlag")
 27933                        .HasColumnType("INTEGER");
 27934
 27935                    b.Property<bool?>("Hdr10PlusPresentFlag")
 27936                        .HasColumnType("INTEGER");
 27937
 27938                    b.Property<int?>("Height")
 27939                        .HasColumnType("INTEGER");
 27940
 27941                    b.Property<bool?>("IsAnamorphic")
 27942                        .HasColumnType("INTEGER");
 27943
 27944                    b.Property<bool?>("IsAvc")
 27945                        .HasColumnType("INTEGER");
 27946
 27947                    b.Property<bool>("IsDefault")
 27948                        .HasColumnType("INTEGER");
 27949
 27950                    b.Property<bool>("IsExternal")
 27951                        .HasColumnType("INTEGER");
 27952
 27953                    b.Property<bool>("IsForced")
 27954                        .HasColumnType("INTEGER");
 27955
 27956                    b.Property<bool?>("IsHearingImpaired")
 27957                        .HasColumnType("INTEGER");
 27958
 27959                    b.Property<bool?>("IsInterlaced")
 27960                        .HasColumnType("INTEGER");
 27961
 27962                    b.Property<bool>("IsOriginal")
 27963                        .HasColumnType("INTEGER");
 27964
 27965                    b.Property<string>("KeyFrames")
 27966                        .HasColumnType("TEXT");
 27967
 27968                    b.Property<string>("Language")
 27969                        .HasColumnType("TEXT");
 27970
 27971                    b.Property<float?>("Level")
 27972                        .HasColumnType("REAL");
 27973
 27974                    b.Property<string>("NalLengthSize")
 27975                        .HasColumnType("TEXT");
 27976
 27977                    b.Property<string>("Path")
 27978                        .HasColumnType("TEXT");
 27979
 27980                    b.Property<string>("PixelFormat")
 27981                        .HasColumnType("TEXT");
 27982
 27983                    b.Property<string>("Profile")
 27984                        .HasColumnType("TEXT");
 27985
 27986                    b.Property<float?>("RealFrameRate")
 27987                        .HasColumnType("REAL");
 27988
 27989                    b.Property<int?>("RefFrames")
 27990                        .HasColumnType("INTEGER");
 27991
 27992                    b.Property<int?>("Rotation")
 27993                        .HasColumnType("INTEGER");
 27994
 27995                    b.Property<int?>("RpuPresentFlag")
 27996                        .HasColumnType("INTEGER");
 27997
 27998                    b.Property<int?>("SampleRate")
 27999                        .HasColumnType("INTEGER");
 271000
 271001                    b.Property<int>("StreamType")
 271002                        .HasColumnType("INTEGER");
 271003
 271004                    b.Property<string>("TimeBase")
 271005                        .HasColumnType("TEXT");
 271006
 271007                    b.Property<string>("Title")
 271008                        .HasColumnType("TEXT");
 271009
 271010                    b.Property<int?>("Width")
 271011                        .HasColumnType("INTEGER");
 271012
 271013                    b.HasKey("ItemId", "StreamIndex");
 271014
 271015                    b.ToTable("MediaStreamInfos");
 271016
 271017                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271018                });
 1019
 271020            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 271021                {
 271022                    b.Property<Guid>("Id")
 271023                        .ValueGeneratedOnAdd()
 271024                        .HasColumnType("TEXT");
 271025
 271026                    b.Property<string>("Name")
 271027                        .IsRequired()
 271028                        .HasColumnType("TEXT");
 271029
 271030                    b.Property<string>("PersonType")
 271031                        .HasColumnType("TEXT");
 271032
 271033                    b.HasKey("Id");
 271034
 271035                    b.HasIndex("Name");
 271036
 271037                    b.ToTable("Peoples");
 271038
 271039                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271040                });
 1041
 271042            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 271043                {
 271044                    b.Property<Guid>("ItemId")
 271045                        .HasColumnType("TEXT");
 271046
 271047                    b.Property<Guid>("PeopleId")
 271048                        .HasColumnType("TEXT");
 271049
 271050                    b.Property<string>("Role")
 271051                        .HasColumnType("TEXT");
 271052
 271053                    b.Property<int?>("ListOrder")
 271054                        .HasColumnType("INTEGER");
 271055
 271056                    b.Property<int?>("SortOrder")
 271057                        .HasColumnType("INTEGER");
 271058
 271059                    b.HasKey("ItemId", "PeopleId", "Role");
 271060
 271061                    b.HasIndex("PeopleId");
 271062
 271063                    b.HasIndex("ItemId", "ListOrder");
 271064
 271065                    b.HasIndex("ItemId", "SortOrder");
 271066
 271067                    b.ToTable("PeopleBaseItemMap");
 271068
 271069                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271070                });
 1071
 271072            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 271073                {
 271074                    b.Property<int>("Id")
 271075                        .ValueGeneratedOnAdd()
 271076                        .HasColumnType("INTEGER");
 271077
 271078                    b.Property<int>("Kind")
 271079                        .HasColumnType("INTEGER");
 271080
 271081                    b.Property<Guid?>("Permission_Permissions_Guid")
 271082                        .HasColumnType("TEXT");
 271083
 271084                    b.Property<uint>("RowVersion")
 271085                        .IsConcurrencyToken()
 271086                        .HasColumnType("INTEGER");
 271087
 271088                    b.Property<Guid?>("UserId")
 271089                        .HasColumnType("TEXT");
 271090
 271091                    b.Property<bool>("Value")
 271092                        .HasColumnType("INTEGER");
 271093
 271094                    b.HasKey("Id");
 271095
 271096                    b.HasIndex("UserId", "Kind")
 271097                        .IsUnique()
 271098                        .HasFilter("[UserId] IS NOT NULL");
 271099
 271100                    b.ToTable("Permissions");
 271101
 271102                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271103                });
 1104
 271105            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 271106                {
 271107                    b.Property<int>("Id")
 271108                        .ValueGeneratedOnAdd()
 271109                        .HasColumnType("INTEGER");
 271110
 271111                    b.Property<int>("Kind")
 271112                        .HasColumnType("INTEGER");
 271113
 271114                    b.Property<Guid?>("Preference_Preferences_Guid")
 271115                        .HasColumnType("TEXT");
 271116
 271117                    b.Property<uint>("RowVersion")
 271118                        .IsConcurrencyToken()
 271119                        .HasColumnType("INTEGER");
 271120
 271121                    b.Property<Guid?>("UserId")
 271122                        .HasColumnType("TEXT");
 271123
 271124                    b.Property<string>("Value")
 271125                        .IsRequired()
 271126                        .HasMaxLength(65535)
 271127                        .HasColumnType("TEXT");
 271128
 271129                    b.HasKey("Id");
 271130
 271131                    b.HasIndex("UserId", "Kind")
 271132                        .IsUnique()
 271133                        .HasFilter("[UserId] IS NOT NULL");
 271134
 271135                    b.ToTable("Preferences");
 271136
 271137                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271138                });
 1139
 271140            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.ApiKey", b =>
 271141                {
 271142                    b.Property<int>("Id")
 271143                        .ValueGeneratedOnAdd()
 271144                        .HasColumnType("INTEGER");
 271145
 271146                    b.Property<string>("AccessToken")
 271147                        .IsRequired()
 271148                        .HasColumnType("TEXT");
 271149
 271150                    b.Property<DateTime>("DateCreated")
 271151                        .HasColumnType("TEXT");
 271152
 271153                    b.Property<DateTime>("DateLastActivity")
 271154                        .HasColumnType("TEXT");
 271155
 271156                    b.Property<string>("Name")
 271157                        .IsRequired()
 271158                        .HasMaxLength(64)
 271159                        .HasColumnType("TEXT");
 271160
 271161                    b.HasKey("Id");
 271162
 271163                    b.HasIndex("AccessToken")
 271164                        .IsUnique();
 271165
 271166                    b.ToTable("ApiKeys");
 271167
 271168                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271169                });
 1170
 271171            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 271172                {
 271173                    b.Property<int>("Id")
 271174                        .ValueGeneratedOnAdd()
 271175                        .HasColumnType("INTEGER");
 271176
 271177                    b.Property<string>("AccessToken")
 271178                        .IsRequired()
 271179                        .HasColumnType("TEXT");
 271180
 271181                    b.Property<string>("AppName")
 271182                        .IsRequired()
 271183                        .HasMaxLength(64)
 271184                        .HasColumnType("TEXT");
 271185
 271186                    b.Property<string>("AppVersion")
 271187                        .IsRequired()
 271188                        .HasMaxLength(32)
 271189                        .HasColumnType("TEXT");
 271190
 271191                    b.Property<DateTime>("DateCreated")
 271192                        .HasColumnType("TEXT");
 271193
 271194                    b.Property<DateTime>("DateLastActivity")
 271195                        .HasColumnType("TEXT");
 271196
 271197                    b.Property<DateTime>("DateModified")
 271198                        .HasColumnType("TEXT");
 271199
 271200                    b.Property<string>("DeviceId")
 271201                        .IsRequired()
 271202                        .HasMaxLength(256)
 271203                        .HasColumnType("TEXT");
 271204
 271205                    b.Property<string>("DeviceName")
 271206                        .IsRequired()
 271207                        .HasMaxLength(64)
 271208                        .HasColumnType("TEXT");
 271209
 271210                    b.Property<bool>("IsActive")
 271211                        .HasColumnType("INTEGER");
 271212
 271213                    b.Property<Guid>("UserId")
 271214                        .HasColumnType("TEXT");
 271215
 271216                    b.HasKey("Id");
 271217
 271218                    b.HasIndex("AccessToken", "DateLastActivity");
 271219
 271220                    b.HasIndex("DeviceId", "DateLastActivity");
 271221
 271222                    b.HasIndex("UserId", "DeviceId");
 271223
 271224                    b.ToTable("Devices");
 271225
 271226                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271227                });
 1228
 271229            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.DeviceOptions", b =>
 271230                {
 271231                    b.Property<int>("Id")
 271232                        .ValueGeneratedOnAdd()
 271233                        .HasColumnType("INTEGER");
 271234
 271235                    b.Property<string>("CustomName")
 271236                        .HasColumnType("TEXT");
 271237
 271238                    b.Property<string>("DeviceId")
 271239                        .IsRequired()
 271240                        .HasColumnType("TEXT");
 271241
 271242                    b.HasKey("Id");
 271243
 271244                    b.HasIndex("DeviceId")
 271245                        .IsUnique();
 271246
 271247                    b.ToTable("DeviceOptions");
 271248
 271249                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271250                });
 1251
 271252            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.TrickplayInfo", b =>
 271253                {
 271254                    b.Property<Guid>("ItemId")
 271255                        .HasColumnType("TEXT");
 271256
 271257                    b.Property<int>("Width")
 271258                        .HasColumnType("INTEGER");
 271259
 271260                    b.Property<int>("Bandwidth")
 271261                        .HasColumnType("INTEGER");
 271262
 271263                    b.Property<int>("Height")
 271264                        .HasColumnType("INTEGER");
 271265
 271266                    b.Property<int>("Interval")
 271267                        .HasColumnType("INTEGER");
 271268
 271269                    b.Property<int>("ThumbnailCount")
 271270                        .HasColumnType("INTEGER");
 271271
 271272                    b.Property<int>("TileHeight")
 271273                        .HasColumnType("INTEGER");
 271274
 271275                    b.Property<int>("TileWidth")
 271276                        .HasColumnType("INTEGER");
 271277
 271278                    b.HasKey("ItemId", "Width");
 271279
 271280                    b.ToTable("TrickplayInfos");
 271281
 271282                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271283                });
 1284
 271285            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 271286                {
 271287                    b.Property<Guid>("Id")
 271288                        .ValueGeneratedOnAdd()
 271289                        .HasColumnType("TEXT");
 271290
 271291                    b.Property<string>("AudioLanguagePreference")
 271292                        .HasMaxLength(255)
 271293                        .HasColumnType("TEXT");
 271294
 271295                    b.Property<string>("AuthenticationProviderId")
 271296                        .IsRequired()
 271297                        .HasMaxLength(255)
 271298                        .HasColumnType("TEXT");
 271299
 271300                    b.Property<string>("CastReceiverId")
 271301                        .HasMaxLength(32)
 271302                        .HasColumnType("TEXT");
 271303
 271304                    b.Property<bool>("DisplayCollectionsView")
 271305                        .HasColumnType("INTEGER");
 271306
 271307                    b.Property<bool>("DisplayMissingEpisodes")
 271308                        .HasColumnType("INTEGER");
 271309
 271310                    b.Property<bool>("EnableAutoLogin")
 271311                        .HasColumnType("INTEGER");
 271312
 271313                    b.Property<bool>("EnableLocalPassword")
 271314                        .HasColumnType("INTEGER");
 271315
 271316                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 271317                        .HasColumnType("INTEGER");
 271318
 271319                    b.Property<bool>("EnableUserPreferenceAccess")
 271320                        .HasColumnType("INTEGER");
 271321
 271322                    b.Property<bool>("HidePlayedInLatest")
 271323                        .HasColumnType("INTEGER");
 271324
 271325                    b.Property<long>("InternalId")
 271326                        .HasColumnType("INTEGER");
 271327
 271328                    b.Property<int>("InvalidLoginAttemptCount")
 271329                        .HasColumnType("INTEGER");
 271330
 271331                    b.Property<DateTime?>("LastActivityDate")
 271332                        .HasColumnType("TEXT");
 271333
 271334                    b.Property<DateTime?>("LastLoginDate")
 271335                        .HasColumnType("TEXT");
 271336
 271337                    b.Property<int?>("LoginAttemptsBeforeLockout")
 271338                        .HasColumnType("INTEGER");
 271339
 271340                    b.Property<int>("MaxActiveSessions")
 271341                        .HasColumnType("INTEGER");
 271342
 271343                    b.Property<int?>("MaxParentalRatingScore")
 271344                        .HasColumnType("INTEGER");
 271345
 271346                    b.Property<int?>("MaxParentalRatingSubScore")
 271347                        .HasColumnType("INTEGER");
 271348
 271349                    b.Property<bool>("MustUpdatePassword")
 271350                        .HasColumnType("INTEGER");
 271351
 271352                    b.Property<string>("NormalizedUsername")
 271353                        .IsRequired()
 271354                        .HasMaxLength(255)
 271355                        .HasColumnType("TEXT");
 271356
 271357                    b.Property<string>("Password")
 271358                        .HasMaxLength(65535)
 271359                        .HasColumnType("TEXT");
 271360
 271361                    b.Property<string>("PasswordResetProviderId")
 271362                        .IsRequired()
 271363                        .HasMaxLength(255)
 271364                        .HasColumnType("TEXT");
 271365
 271366                    b.Property<bool>("PlayDefaultAudioTrack")
 271367                        .HasColumnType("INTEGER");
 271368
 271369                    b.Property<bool>("RememberAudioSelections")
 271370                        .HasColumnType("INTEGER");
 271371
 271372                    b.Property<bool>("RememberSubtitleSelections")
 271373                        .HasColumnType("INTEGER");
 271374
 271375                    b.Property<int?>("RemoteClientBitrateLimit")
 271376                        .HasColumnType("INTEGER");
 271377
 271378                    b.Property<uint>("RowVersion")
 271379                        .IsConcurrencyToken()
 271380                        .HasColumnType("INTEGER");
 271381
 271382                    b.Property<string>("SubtitleLanguagePreference")
 271383                        .HasMaxLength(255)
 271384                        .HasColumnType("TEXT");
 271385
 271386                    b.Property<int>("SubtitleMode")
 271387                        .HasColumnType("INTEGER");
 271388
 271389                    b.Property<int>("SyncPlayAccess")
 271390                        .HasColumnType("INTEGER");
 271391
 271392                    b.Property<string>("Username")
 271393                        .IsRequired()
 271394                        .HasMaxLength(255)
 271395                        .HasColumnType("TEXT");
 271396
 271397                    b.HasKey("Id");
 271398
 271399                    b.HasIndex("NormalizedUsername")
 271400                        .IsUnique();
 271401
 271402                    b.HasIndex("Username")
 271403                        .IsUnique();
 271404
 271405                    b.ToTable("Users");
 271406
 271407                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271408                });
 1409
 271410            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 271411                {
 271412                    b.Property<Guid>("ItemId")
 271413                        .HasColumnType("TEXT");
 271414
 271415                    b.Property<Guid>("UserId")
 271416                        .HasColumnType("TEXT");
 271417
 271418                    b.Property<string>("CustomDataKey")
 271419                        .HasColumnType("TEXT");
 271420
 271421                    b.Property<int?>("AudioStreamIndex")
 271422                        .HasColumnType("INTEGER");
 271423
 271424                    b.Property<bool>("IsFavorite")
 271425                        .HasColumnType("INTEGER");
 271426
 271427                    b.Property<DateTime?>("LastPlayedDate")
 271428                        .HasColumnType("TEXT");
 271429
 271430                    b.Property<bool?>("Likes")
 271431                        .HasColumnType("INTEGER");
 271432
 271433                    b.Property<int>("PlayCount")
 271434                        .HasColumnType("INTEGER");
 271435
 271436                    b.Property<long>("PlaybackPositionTicks")
 271437                        .HasColumnType("INTEGER");
 271438
 271439                    b.Property<bool>("Played")
 271440                        .HasColumnType("INTEGER");
 271441
 271442                    b.Property<double?>("Rating")
 271443                        .HasColumnType("REAL");
 271444
 271445                    b.Property<DateTime?>("RetentionDate")
 271446                        .HasColumnType("TEXT");
 271447
 271448                    b.Property<int?>("SubtitleStreamIndex")
 271449                        .HasColumnType("INTEGER");
 271450
 271451                    b.HasKey("ItemId", "UserId", "CustomDataKey");
 271452
 271453                    b.HasIndex("ItemId", "UserId", "IsFavorite");
 271454
 271455                    b.HasIndex("ItemId", "UserId", "LastPlayedDate");
 271456
 271457                    b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
 271458
 271459                    b.HasIndex("ItemId", "UserId", "Played");
 271460
 271461                    b.HasIndex("UserId", "IsFavorite", "ItemId");
 271462
 271463                    b.HasIndex("UserId", "ItemId", "LastPlayedDate");
 271464
 271465                    b.HasIndex("UserId", "Played", "ItemId");
 271466
 271467                    b.ToTable("UserData");
 271468
 271469                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271470                });
 1471
 271472            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 271473                {
 271474                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271475                        .WithMany("AccessSchedules")
 271476                        .HasForeignKey("UserId")
 271477                        .OnDelete(DeleteBehavior.Cascade)
 271478                        .IsRequired();
 271479                });
 1480
 271481            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 271482                {
 271483                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271484                        .WithMany("Parents")
 271485                        .HasForeignKey("ItemId")
 271486                        .OnDelete(DeleteBehavior.Cascade)
 271487                        .IsRequired();
 271488
 271489                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "ParentItem")
 271490                        .WithMany("Children")
 271491                        .HasForeignKey("ParentItemId")
 271492                        .OnDelete(DeleteBehavior.Cascade)
 271493                        .IsRequired();
 271494
 271495                    b.Navigation("Item");
 271496
 271497                    b.Navigation("ParentItem");
 271498                });
 1499
 271500            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 271501                {
 271502                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271503                        .WithMany()
 271504                        .HasForeignKey("ItemId")
 271505                        .OnDelete(DeleteBehavior.Cascade)
 271506                        .IsRequired();
 271507
 271508                    b.Navigation("Item");
 271509                });
 1510
 271511            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 271512                {
 271513                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Owner")
 271514                        .WithMany("Extras")
 271515                        .HasForeignKey("OwnerId")
 271516                        .OnDelete(DeleteBehavior.NoAction);
 271517
 271518                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "DirectParent")
 271519                        .WithMany("DirectChildren")
 271520                        .HasForeignKey("ParentId")
 271521                        .OnDelete(DeleteBehavior.Cascade);
 271522
 271523                    b.Navigation("DirectParent");
 271524
 271525                    b.Navigation("Owner");
 271526                });
 1527
 271528            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 271529                {
 271530                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271531                        .WithMany("Images")
 271532                        .HasForeignKey("ItemId")
 271533                        .OnDelete(DeleteBehavior.Cascade)
 271534                        .IsRequired();
 271535
 271536                    b.Navigation("Item");
 271537                });
 1538
 271539            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 271540                {
 271541                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271542                        .WithMany("LockedFields")
 271543                        .HasForeignKey("ItemId")
 271544                        .OnDelete(DeleteBehavior.Cascade)
 271545                        .IsRequired();
 271546
 271547                    b.Navigation("Item");
 271548                });
 1549
 271550            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 271551                {
 271552                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271553                        .WithMany("Provider")
 271554                        .HasForeignKey("ItemId")
 271555                        .OnDelete(DeleteBehavior.Cascade)
 271556                        .IsRequired();
 271557
 271558                    b.Navigation("Item");
 271559                });
 1560
 271561            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 271562                {
 271563                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271564                        .WithMany("TrailerTypes")
 271565                        .HasForeignKey("ItemId")
 271566                        .OnDelete(DeleteBehavior.Cascade)
 271567                        .IsRequired();
 271568
 271569                    b.Navigation("Item");
 271570                });
 1571
 271572            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 271573                {
 271574                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271575                        .WithMany("Chapters")
 271576                        .HasForeignKey("ItemId")
 271577                        .OnDelete(DeleteBehavior.Cascade)
 271578                        .IsRequired();
 271579
 271580                    b.Navigation("Item");
 271581                });
 1582
 271583            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 271584                {
 271585                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271586                        .WithMany("DisplayPreferences")
 271587                        .HasForeignKey("UserId")
 271588                        .OnDelete(DeleteBehavior.Cascade)
 271589                        .IsRequired();
 271590                });
 1591
 271592            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 271593                {
 271594                    b.HasOne("Jellyfin.Database.Implementations.Entities.DisplayPreferences", null)
 271595                        .WithMany("HomeSections")
 271596                        .HasForeignKey("DisplayPreferencesId")
 271597                        .OnDelete(DeleteBehavior.Cascade)
 271598                        .IsRequired();
 271599                });
 1600
 271601            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 271602                {
 271603                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271604                        .WithOne("ProfileImage")
 271605                        .HasForeignKey("Jellyfin.Database.Implementations.Entities.ImageInfo", "UserId")
 271606                        .OnDelete(DeleteBehavior.Cascade);
 271607                });
 1608
 271609            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 271610                {
 271611                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271612                        .WithMany("ItemDisplayPreferences")
 271613                        .HasForeignKey("UserId")
 271614                        .OnDelete(DeleteBehavior.Cascade)
 271615                        .IsRequired();
 271616                });
 1617
 271618            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 271619                {
 271620                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271621                        .WithMany("ItemValues")
 271622                        .HasForeignKey("ItemId")
 271623                        .OnDelete(DeleteBehavior.Cascade)
 271624                        .IsRequired();
 271625
 271626                    b.HasOne("Jellyfin.Database.Implementations.Entities.ItemValue", "ItemValue")
 271627                        .WithMany("BaseItemsMap")
 271628                        .HasForeignKey("ItemValueId")
 271629                        .OnDelete(DeleteBehavior.Cascade)
 271630                        .IsRequired();
 271631
 271632                    b.Navigation("Item");
 271633
 271634                    b.Navigation("ItemValue");
 271635                });
 1636
 271637            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 271638                {
 271639                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271640                        .WithMany()
 271641                        .HasForeignKey("ItemId")
 271642                        .OnDelete(DeleteBehavior.Cascade)
 271643                        .IsRequired();
 271644
 271645                    b.Navigation("Item");
 271646                });
 1647
 271648            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 271649                {
 271650                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Child")
 271651                        .WithMany("LinkedChildOfEntities")
 271652                        .HasForeignKey("ChildId")
 271653                        .OnDelete(DeleteBehavior.NoAction)
 271654                        .IsRequired();
 271655
 271656                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Parent")
 271657                        .WithMany("LinkedChildEntities")
 271658                        .HasForeignKey("ParentId")
 271659                        .OnDelete(DeleteBehavior.NoAction)
 271660                        .IsRequired();
 271661
 271662                    b.Navigation("Child");
 271663
 271664                    b.Navigation("Parent");
 271665                });
 1666
 271667            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 271668                {
 271669                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271670                        .WithMany("MediaStreams")
 271671                        .HasForeignKey("ItemId")
 271672                        .OnDelete(DeleteBehavior.Cascade)
 271673                        .IsRequired();
 271674
 271675                    b.Navigation("Item");
 271676                });
 1677
 271678            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 271679                {
 271680                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271681                        .WithMany("Peoples")
 271682                        .HasForeignKey("ItemId")
 271683                        .OnDelete(DeleteBehavior.Cascade)
 271684                        .IsRequired();
 271685
 271686                    b.HasOne("Jellyfin.Database.Implementations.Entities.People", "People")
 271687                        .WithMany("BaseItems")
 271688                        .HasForeignKey("PeopleId")
 271689                        .OnDelete(DeleteBehavior.Cascade)
 271690                        .IsRequired();
 271691
 271692                    b.Navigation("Item");
 271693
 271694                    b.Navigation("People");
 271695                });
 1696
 271697            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 271698                {
 271699                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271700                        .WithMany("Permissions")
 271701                        .HasForeignKey("UserId")
 271702                        .OnDelete(DeleteBehavior.Cascade);
 271703                });
 1704
 271705            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 271706                {
 271707                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271708                        .WithMany("Preferences")
 271709                        .HasForeignKey("UserId")
 271710                        .OnDelete(DeleteBehavior.Cascade);
 271711                });
 1712
 271713            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 271714                {
 271715                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 271716                        .WithMany()
 271717                        .HasForeignKey("UserId")
 271718                        .OnDelete(DeleteBehavior.Cascade)
 271719                        .IsRequired();
 271720
 271721                    b.Navigation("User");
 271722                });
 1723
 271724            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 271725                {
 271726                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271727                        .WithMany("UserData")
 271728                        .HasForeignKey("ItemId")
 271729                        .OnDelete(DeleteBehavior.Cascade)
 271730                        .IsRequired();
 271731
 271732                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 271733                        .WithMany()
 271734                        .HasForeignKey("UserId")
 271735                        .OnDelete(DeleteBehavior.Cascade)
 271736                        .IsRequired();
 271737
 271738                    b.Navigation("Item");
 271739
 271740                    b.Navigation("User");
 271741                });
 1742
 271743            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 271744                {
 271745                    b.Navigation("Chapters");
 271746
 271747                    b.Navigation("Children");
 271748
 271749                    b.Navigation("DirectChildren");
 271750
 271751                    b.Navigation("Extras");
 271752
 271753                    b.Navigation("Images");
 271754
 271755                    b.Navigation("ItemValues");
 271756
 271757                    b.Navigation("LinkedChildEntities");
 271758
 271759                    b.Navigation("LinkedChildOfEntities");
 271760
 271761                    b.Navigation("LockedFields");
 271762
 271763                    b.Navigation("MediaStreams");
 271764
 271765                    b.Navigation("Parents");
 271766
 271767                    b.Navigation("Peoples");
 271768
 271769                    b.Navigation("Provider");
 271770
 271771                    b.Navigation("TrailerTypes");
 271772
 271773                    b.Navigation("UserData");
 271774                });
 1775
 271776            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 271777                {
 271778                    b.Navigation("HomeSections");
 271779                });
 1780
 271781            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 271782                {
 271783                    b.Navigation("BaseItemsMap");
 271784                });
 1785
 271786            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 271787                {
 271788                    b.Navigation("BaseItems");
 271789                });
 1790
 271791            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 271792                {
 271793                    b.Navigation("AccessSchedules");
 271794
 271795                    b.Navigation("DisplayPreferences");
 271796
 271797                    b.Navigation("ItemDisplayPreferences");
 271798
 271799                    b.Navigation("Permissions");
 271800
 271801                    b.Navigation("Preferences");
 271802
 271803                    b.Navigation("ProfileImage");
 271804                });
 1805#pragma warning restore 612, 618
 271806        }
 1807    }
 1808}