< Summary - Jellyfin

Line coverage
98%
Covered lines: 1761
Uncovered lines: 31
Coverable lines: 1792
Total lines: 1905
Line coverage: 98.2%
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 5/16/2026 - 12:15:55 AM Line coverage: 98.5% (1731/1756) Total lines: 18635/22/2026 - 12:15:17 AM Line coverage: 98.2% (1758/1789) Total lines: 19028/11/2026 - 12:17:00 AM Line coverage: 98.2% (1761/1792) Total lines: 1905

Coverage delta

Coverage delta 1 -1

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/20260113233000_AddForeignKeyToOwnerId.cs

#LineLine coverage
 1using System;
 2using Microsoft.EntityFrameworkCore.Migrations;
 3
 4#nullable disable
 5
 6namespace Jellyfin.Database.Providers.Sqlite.Migrations
 7{
 8    /// <inheritdoc />
 9    public partial class AddForeignKeyToOwnerId : Migration
 10    {
 11        /// <inheritdoc />
 12        protected override void Up(MigrationBuilder migrationBuilder)
 13        {
 2714            migrationBuilder.DropForeignKey(
 2715                name: "FK_BaseItems_BaseItems_BaseItemEntityId",
 2716                table: "BaseItems");
 17
 2718            migrationBuilder.DropIndex(
 2719                name: "IX_BaseItems_BaseItemEntityId",
 2720                table: "BaseItems");
 21
 2722            migrationBuilder.DropColumn(
 2723                name: "BaseItemEntityId",
 2724                table: "BaseItems");
 25
 2726            migrationBuilder.Sql(
 2727                """
 2728                UPDATE BaseItems
 2729                SET OwnerId = '00000000-0000-0000-0000-000000000001'
 2730                WHERE OwnerId IS NOT NULL
 2731                  AND OwnerId NOT IN (SELECT Id FROM BaseItems);
 2732                """);
 33
 2734            migrationBuilder.AddForeignKey(
 2735                name: "FK_BaseItems_BaseItems_OwnerId",
 2736                table: "BaseItems",
 2737                column: "OwnerId",
 2738                principalTable: "BaseItems",
 2739                principalColumn: "Id");
 40
 2741            migrationBuilder.AddColumn<bool>(
 2742                name: "IsOriginal",
 2743                table: "MediaStreamInfos",
 2744                type: "INTEGER",
 2745                nullable: false,
 2746                defaultValue: false);
 47
 2748            migrationBuilder.AddColumn<string>(
 2749                name: "OriginalLanguage",
 2750                table: "BaseItems",
 2751                type: "TEXT",
 2752                nullable: true);
 53
 2754            migrationBuilder.UpdateData(
 2755                table: "BaseItems",
 2756                keyColumn: "Id",
 2757                keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
 2758                column: "OriginalLanguage",
 2759                value: null);
 2760        }
 61
 62        /// <inheritdoc />
 63        protected override void Down(MigrationBuilder migrationBuilder)
 64        {
 065            migrationBuilder.DropForeignKey(
 066                name: "FK_BaseItems_BaseItems_OwnerId",
 067                table: "BaseItems");
 68
 069            migrationBuilder.AddColumn<Guid>(
 070                name: "BaseItemEntityId",
 071                table: "BaseItems",
 072                type: "TEXT",
 073                nullable: true);
 74
 075            migrationBuilder.UpdateData(
 076                table: "BaseItems",
 077                keyColumn: "Id",
 078                keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
 079                column: "BaseItemEntityId",
 080                value: null);
 81
 082            migrationBuilder.CreateIndex(
 083                name: "IX_BaseItems_BaseItemEntityId",
 084                table: "BaseItems",
 085                column: "BaseItemEntityId");
 86
 087            migrationBuilder.AddForeignKey(
 088                name: "FK_BaseItems_BaseItems_BaseItemEntityId",
 089                table: "BaseItems",
 090                column: "BaseItemEntityId",
 091                principalTable: "BaseItems",
 092                principalColumn: "Id");
 93
 094            migrationBuilder.DropColumn(
 095                name: "IsOriginal",
 096                table: "MediaStreamInfos");
 97
 098            migrationBuilder.DropColumn(
 099                name: "OriginalLanguage",
 0100                table: "BaseItems");
 0101        }
 102    }
 103}

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20260113233000_AddForeignKeyToOwnerId.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("20260113233000_AddForeignKeyToOwnerId")]
 15    partial class AddForeignKeyToOwnerId
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 2721            modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
 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<string>("ExtraIds")
 27214                        .HasColumnType("TEXT");
 27215
 27216                    b.Property<int?>("ExtraType")
 27217                        .HasColumnType("INTEGER");
 27218
 27219                    b.Property<string>("ForcedSortName")
 27220                        .HasColumnType("TEXT");
 27221
 27222                    b.Property<string>("Genres")
 27223                        .HasColumnType("TEXT");
 27224
 27225                    b.Property<int?>("Height")
 27226                        .HasColumnType("INTEGER");
 27227
 27228                    b.Property<int?>("IndexNumber")
 27229                        .HasColumnType("INTEGER");
 27230
 27231                    b.Property<int?>("InheritedParentalRatingSubValue")
 27232                        .HasColumnType("INTEGER");
 27233
 27234                    b.Property<int?>("InheritedParentalRatingValue")
 27235                        .HasColumnType("INTEGER");
 27236
 27237                    b.Property<bool>("IsFolder")
 27238                        .HasColumnType("INTEGER");
 27239
 27240                    b.Property<bool>("IsInMixedFolder")
 27241                        .HasColumnType("INTEGER");
 27242
 27243                    b.Property<bool>("IsLocked")
 27244                        .HasColumnType("INTEGER");
 27245
 27246                    b.Property<bool>("IsMovie")
 27247                        .HasColumnType("INTEGER");
 27248
 27249                    b.Property<bool>("IsRepeat")
 27250                        .HasColumnType("INTEGER");
 27251
 27252                    b.Property<bool>("IsSeries")
 27253                        .HasColumnType("INTEGER");
 27254
 27255                    b.Property<bool>("IsVirtualItem")
 27256                        .HasColumnType("INTEGER");
 27257
 27258                    b.Property<float?>("LUFS")
 27259                        .HasColumnType("REAL");
 27260
 27261                    b.Property<string>("MediaType")
 27262                        .HasColumnType("TEXT");
 27263
 27264                    b.Property<string>("Name")
 27265                        .HasColumnType("TEXT");
 27266
 27267                    b.Property<float?>("NormalizationGain")
 27268                        .HasColumnType("REAL");
 27269
 27270                    b.Property<string>("OfficialRating")
 27271                        .HasColumnType("TEXT");
 27272
 27273                    b.Property<string>("OriginalLanguage")
 27274                        .HasColumnType("TEXT");
 27275
 27276                    b.Property<string>("OriginalTitle")
 27277                        .HasColumnType("TEXT");
 27278
 27279                    b.Property<string>("Overview")
 27280                        .HasColumnType("TEXT");
 27281
 27282                    b.Property<Guid?>("OwnerId")
 27283                        .HasColumnType("TEXT");
 27284
 27285                    b.Property<Guid?>("ParentId")
 27286                        .HasColumnType("TEXT");
 27287
 27288                    b.Property<int?>("ParentIndexNumber")
 27289                        .HasColumnType("INTEGER");
 27290
 27291                    b.Property<string>("Path")
 27292                        .HasColumnType("TEXT");
 27293
 27294                    b.Property<string>("PreferredMetadataCountryCode")
 27295                        .HasColumnType("TEXT");
 27296
 27297                    b.Property<string>("PreferredMetadataLanguage")
 27298                        .HasColumnType("TEXT");
 27299
 27300                    b.Property<DateTime?>("PremiereDate")
 27301                        .HasColumnType("TEXT");
 27302
 27303                    b.Property<string>("PresentationUniqueKey")
 27304                        .HasColumnType("TEXT");
 27305
 27306                    b.Property<string>("PrimaryVersionId")
 27307                        .HasColumnType("TEXT");
 27308
 27309                    b.Property<string>("ProductionLocations")
 27310                        .HasColumnType("TEXT");
 27311
 27312                    b.Property<int?>("ProductionYear")
 27313                        .HasColumnType("INTEGER");
 27314
 27315                    b.Property<long?>("RunTimeTicks")
 27316                        .HasColumnType("INTEGER");
 27317
 27318                    b.Property<Guid?>("SeasonId")
 27319                        .HasColumnType("TEXT");
 27320
 27321                    b.Property<string>("SeasonName")
 27322                        .HasColumnType("TEXT");
 27323
 27324                    b.Property<Guid?>("SeriesId")
 27325                        .HasColumnType("TEXT");
 27326
 27327                    b.Property<string>("SeriesName")
 27328                        .HasColumnType("TEXT");
 27329
 27330                    b.Property<string>("SeriesPresentationUniqueKey")
 27331                        .HasColumnType("TEXT");
 27332
 27333                    b.Property<string>("ShowId")
 27334                        .HasColumnType("TEXT");
 27335
 27336                    b.Property<long?>("Size")
 27337                        .HasColumnType("INTEGER");
 27338
 27339                    b.Property<string>("SortName")
 27340                        .HasColumnType("TEXT");
 27341
 27342                    b.Property<DateTime?>("StartDate")
 27343                        .HasColumnType("TEXT");
 27344
 27345                    b.Property<string>("Studios")
 27346                        .HasColumnType("TEXT");
 27347
 27348                    b.Property<string>("Tagline")
 27349                        .HasColumnType("TEXT");
 27350
 27351                    b.Property<string>("Tags")
 27352                        .HasColumnType("TEXT");
 27353
 27354                    b.Property<Guid?>("TopParentId")
 27355                        .HasColumnType("TEXT");
 27356
 27357                    b.Property<int?>("TotalBitrate")
 27358                        .HasColumnType("INTEGER");
 27359
 27360                    b.Property<string>("Type")
 27361                        .IsRequired()
 27362                        .HasColumnType("TEXT");
 27363
 27364                    b.Property<string>("UnratedType")
 27365                        .HasColumnType("TEXT");
 27366
 27367                    b.Property<int?>("Width")
 27368                        .HasColumnType("INTEGER");
 27369
 27370                    b.HasKey("Id");
 27371
 27372                    b.HasIndex("ExtraType");
 27373
 27374                    b.HasIndex("OwnerId");
 27375
 27376                    b.HasIndex("ParentId");
 27377
 27378                    b.HasIndex("Path");
 27379
 27380                    b.HasIndex("PresentationUniqueKey");
 27381
 27382                    b.HasIndex("ExtraType", "OwnerId");
 27383
 27384                    b.HasIndex("TopParentId", "Id");
 27385
 27386                    b.HasIndex("Type", "TopParentId", "Id");
 27387
 27388                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 27389
 27390                    b.HasIndex("Type", "TopParentId", "StartDate");
 27391
 27392                    b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem");
 27393
 27394                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 27395
 27396                    b.HasIndex("TopParentId", "IsFolder", "IsVirtualItem", "DateCreated");
 27397
 27398                    b.HasIndex("TopParentId", "MediaType", "IsVirtualItem", "DateCreated");
 27399
 27400                    b.HasIndex("TopParentId", "Type", "IsVirtualItem", "DateCreated");
 27401
 27402                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 27403
 27404                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 27405
 27406                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27407
 27408                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27409
 27410                    b.ToTable("BaseItems");
 27411
 27412                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27413
 27414                    b.HasData(
 27415                        new
 27416                        {
 27417                            Id = new Guid("00000000-0000-0000-0000-000000000001"),
 27418                            IsFolder = false,
 27419                            IsInMixedFolder = false,
 27420                            IsLocked = false,
 27421                            IsMovie = false,
 27422                            IsRepeat = false,
 27423                            IsSeries = false,
 27424                            IsVirtualItem = false,
 27425                            Name = "This is a placeholder item for UserData that has been detached from its original ite
 27426                            Type = "PLACEHOLDER"
 27427                        });
 27428                });
 429
 27430            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 27431                {
 27432                    b.Property<Guid>("Id")
 27433                        .ValueGeneratedOnAdd()
 27434                        .HasColumnType("TEXT");
 27435
 27436                    b.Property<byte[]>("Blurhash")
 27437                        .HasColumnType("BLOB");
 27438
 27439                    b.Property<DateTime?>("DateModified")
 27440                        .HasColumnType("TEXT");
 27441
 27442                    b.Property<int>("Height")
 27443                        .HasColumnType("INTEGER");
 27444
 27445                    b.Property<int>("ImageType")
 27446                        .HasColumnType("INTEGER");
 27447
 27448                    b.Property<Guid>("ItemId")
 27449                        .HasColumnType("TEXT");
 27450
 27451                    b.Property<string>("Path")
 27452                        .IsRequired()
 27453                        .HasColumnType("TEXT");
 27454
 27455                    b.Property<int>("Width")
 27456                        .HasColumnType("INTEGER");
 27457
 27458                    b.HasKey("Id");
 27459
 27460                    b.HasIndex("ItemId");
 27461
 27462                    b.ToTable("BaseItemImageInfos");
 27463
 27464                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27465                });
 466
 27467            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 27468                {
 27469                    b.Property<int>("Id")
 27470                        .HasColumnType("INTEGER");
 27471
 27472                    b.Property<Guid>("ItemId")
 27473                        .HasColumnType("TEXT");
 27474
 27475                    b.HasKey("Id", "ItemId");
 27476
 27477                    b.HasIndex("ItemId");
 27478
 27479                    b.ToTable("BaseItemMetadataFields");
 27480
 27481                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27482                });
 483
 27484            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 27485                {
 27486                    b.Property<Guid>("ItemId")
 27487                        .HasColumnType("TEXT");
 27488
 27489                    b.Property<string>("ProviderId")
 27490                        .HasColumnType("TEXT");
 27491
 27492                    b.Property<string>("ProviderValue")
 27493                        .IsRequired()
 27494                        .HasColumnType("TEXT");
 27495
 27496                    b.HasKey("ItemId", "ProviderId");
 27497
 27498                    b.HasIndex("ProviderId", "ProviderValue", "ItemId");
 27499
 27500                    b.ToTable("BaseItemProviders");
 27501
 27502                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27503                });
 504
 27505            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 27506                {
 27507                    b.Property<int>("Id")
 27508                        .HasColumnType("INTEGER");
 27509
 27510                    b.Property<Guid>("ItemId")
 27511                        .HasColumnType("TEXT");
 27512
 27513                    b.HasKey("Id", "ItemId");
 27514
 27515                    b.HasIndex("ItemId");
 27516
 27517                    b.ToTable("BaseItemTrailerTypes");
 27518
 27519                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27520                });
 521
 27522            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 27523                {
 27524                    b.Property<Guid>("ItemId")
 27525                        .HasColumnType("TEXT");
 27526
 27527                    b.Property<int>("ChapterIndex")
 27528                        .HasColumnType("INTEGER");
 27529
 27530                    b.Property<DateTime?>("ImageDateModified")
 27531                        .HasColumnType("TEXT");
 27532
 27533                    b.Property<string>("ImagePath")
 27534                        .HasColumnType("TEXT");
 27535
 27536                    b.Property<string>("Name")
 27537                        .HasColumnType("TEXT");
 27538
 27539                    b.Property<long>("StartPositionTicks")
 27540                        .HasColumnType("INTEGER");
 27541
 27542                    b.HasKey("ItemId", "ChapterIndex");
 27543
 27544                    b.ToTable("Chapters");
 27545
 27546                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27547                });
 548
 27549            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.CustomItemDisplayPreferences", b =>
 27550                {
 27551                    b.Property<int>("Id")
 27552                        .ValueGeneratedOnAdd()
 27553                        .HasColumnType("INTEGER");
 27554
 27555                    b.Property<string>("Client")
 27556                        .IsRequired()
 27557                        .HasMaxLength(32)
 27558                        .HasColumnType("TEXT");
 27559
 27560                    b.Property<Guid>("ItemId")
 27561                        .HasColumnType("TEXT");
 27562
 27563                    b.Property<string>("Key")
 27564                        .IsRequired()
 27565                        .HasColumnType("TEXT");
 27566
 27567                    b.Property<Guid>("UserId")
 27568                        .HasColumnType("TEXT");
 27569
 27570                    b.Property<string>("Value")
 27571                        .HasColumnType("TEXT");
 27572
 27573                    b.HasKey("Id");
 27574
 27575                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 27576                        .IsUnique();
 27577
 27578                    b.ToTable("CustomItemDisplayPreferences");
 27579
 27580                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27581                });
 582
 27583            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 27584                {
 27585                    b.Property<int>("Id")
 27586                        .ValueGeneratedOnAdd()
 27587                        .HasColumnType("INTEGER");
 27588
 27589                    b.Property<int>("ChromecastVersion")
 27590                        .HasColumnType("INTEGER");
 27591
 27592                    b.Property<string>("Client")
 27593                        .IsRequired()
 27594                        .HasMaxLength(32)
 27595                        .HasColumnType("TEXT");
 27596
 27597                    b.Property<string>("DashboardTheme")
 27598                        .HasMaxLength(32)
 27599                        .HasColumnType("TEXT");
 27600
 27601                    b.Property<bool>("EnableNextVideoInfoOverlay")
 27602                        .HasColumnType("INTEGER");
 27603
 27604                    b.Property<int?>("IndexBy")
 27605                        .HasColumnType("INTEGER");
 27606
 27607                    b.Property<Guid>("ItemId")
 27608                        .HasColumnType("TEXT");
 27609
 27610                    b.Property<int>("ScrollDirection")
 27611                        .HasColumnType("INTEGER");
 27612
 27613                    b.Property<bool>("ShowBackdrop")
 27614                        .HasColumnType("INTEGER");
 27615
 27616                    b.Property<bool>("ShowSidebar")
 27617                        .HasColumnType("INTEGER");
 27618
 27619                    b.Property<int>("SkipBackwardLength")
 27620                        .HasColumnType("INTEGER");
 27621
 27622                    b.Property<int>("SkipForwardLength")
 27623                        .HasColumnType("INTEGER");
 27624
 27625                    b.Property<string>("TvHome")
 27626                        .HasMaxLength(32)
 27627                        .HasColumnType("TEXT");
 27628
 27629                    b.Property<Guid>("UserId")
 27630                        .HasColumnType("TEXT");
 27631
 27632                    b.HasKey("Id");
 27633
 27634                    b.HasIndex("UserId", "ItemId", "Client")
 27635                        .IsUnique();
 27636
 27637                    b.ToTable("DisplayPreferences");
 27638
 27639                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27640                });
 641
 27642            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 27643                {
 27644                    b.Property<int>("Id")
 27645                        .ValueGeneratedOnAdd()
 27646                        .HasColumnType("INTEGER");
 27647
 27648                    b.Property<int>("DisplayPreferencesId")
 27649                        .HasColumnType("INTEGER");
 27650
 27651                    b.Property<int>("Order")
 27652                        .HasColumnType("INTEGER");
 27653
 27654                    b.Property<int>("Type")
 27655                        .HasColumnType("INTEGER");
 27656
 27657                    b.HasKey("Id");
 27658
 27659                    b.HasIndex("DisplayPreferencesId");
 27660
 27661                    b.ToTable("HomeSection");
 27662
 27663                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27664                });
 665
 27666            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 27667                {
 27668                    b.Property<int>("Id")
 27669                        .ValueGeneratedOnAdd()
 27670                        .HasColumnType("INTEGER");
 27671
 27672                    b.Property<DateTime>("LastModified")
 27673                        .HasColumnType("TEXT");
 27674
 27675                    b.Property<string>("Path")
 27676                        .IsRequired()
 27677                        .HasMaxLength(512)
 27678                        .HasColumnType("TEXT");
 27679
 27680                    b.Property<Guid?>("UserId")
 27681                        .HasColumnType("TEXT");
 27682
 27683                    b.HasKey("Id");
 27684
 27685                    b.HasIndex("UserId")
 27686                        .IsUnique();
 27687
 27688                    b.ToTable("ImageInfos");
 27689
 27690                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27691                });
 692
 27693            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 27694                {
 27695                    b.Property<int>("Id")
 27696                        .ValueGeneratedOnAdd()
 27697                        .HasColumnType("INTEGER");
 27698
 27699                    b.Property<string>("Client")
 27700                        .IsRequired()
 27701                        .HasMaxLength(32)
 27702                        .HasColumnType("TEXT");
 27703
 27704                    b.Property<int?>("IndexBy")
 27705                        .HasColumnType("INTEGER");
 27706
 27707                    b.Property<Guid>("ItemId")
 27708                        .HasColumnType("TEXT");
 27709
 27710                    b.Property<bool>("RememberIndexing")
 27711                        .HasColumnType("INTEGER");
 27712
 27713                    b.Property<bool>("RememberSorting")
 27714                        .HasColumnType("INTEGER");
 27715
 27716                    b.Property<string>("SortBy")
 27717                        .IsRequired()
 27718                        .HasMaxLength(64)
 27719                        .HasColumnType("TEXT");
 27720
 27721                    b.Property<int>("SortOrder")
 27722                        .HasColumnType("INTEGER");
 27723
 27724                    b.Property<Guid>("UserId")
 27725                        .HasColumnType("TEXT");
 27726
 27727                    b.Property<int>("ViewType")
 27728                        .HasColumnType("INTEGER");
 27729
 27730                    b.HasKey("Id");
 27731
 27732                    b.HasIndex("UserId");
 27733
 27734                    b.ToTable("ItemDisplayPreferences");
 27735
 27736                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27737                });
 738
 27739            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 27740                {
 27741                    b.Property<Guid>("ItemValueId")
 27742                        .ValueGeneratedOnAdd()
 27743                        .HasColumnType("TEXT");
 27744
 27745                    b.Property<string>("CleanValue")
 27746                        .IsRequired()
 27747                        .HasColumnType("TEXT");
 27748
 27749                    b.Property<int>("Type")
 27750                        .HasColumnType("INTEGER");
 27751
 27752                    b.Property<string>("Value")
 27753                        .IsRequired()
 27754                        .HasColumnType("TEXT");
 27755
 27756                    b.HasKey("ItemValueId");
 27757
 27758                    b.HasIndex("Type", "CleanValue");
 27759
 27760                    b.HasIndex("Type", "Value")
 27761                        .IsUnique();
 27762
 27763                    b.ToTable("ItemValues");
 27764
 27765                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27766                });
 767
 27768            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 27769                {
 27770                    b.Property<Guid>("ItemValueId")
 27771                        .HasColumnType("TEXT");
 27772
 27773                    b.Property<Guid>("ItemId")
 27774                        .HasColumnType("TEXT");
 27775
 27776                    b.HasKey("ItemValueId", "ItemId");
 27777
 27778                    b.HasIndex("ItemId");
 27779
 27780                    b.ToTable("ItemValuesMap");
 27781
 27782                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27783                });
 784
 27785            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 27786                {
 27787                    b.Property<Guid>("ItemId")
 27788                        .HasColumnType("TEXT");
 27789
 27790                    b.PrimitiveCollection<string>("KeyframeTicks")
 27791                        .HasColumnType("TEXT");
 27792
 27793                    b.Property<long>("TotalDuration")
 27794                        .HasColumnType("INTEGER");
 27795
 27796                    b.HasKey("ItemId");
 27797
 27798                    b.ToTable("KeyframeData");
 27799
 27800                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27801                });
 802
 27803            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 27804                {
 27805                    b.Property<Guid>("ParentId")
 27806                        .HasColumnType("TEXT");
 27807
 27808                    b.Property<Guid>("ChildId")
 27809                        .HasColumnType("TEXT");
 27810
 27811                    b.Property<int>("ChildType")
 27812                        .HasColumnType("INTEGER");
 27813
 27814                    b.Property<int?>("SortOrder")
 27815                        .HasColumnType("INTEGER");
 27816
 27817                    b.HasKey("ParentId", "ChildId");
 27818
 27819                    b.HasIndex("ChildId");
 27820
 27821                    b.HasIndex("ParentId");
 27822
 27823                    b.HasIndex("ChildId", "ChildType");
 27824
 27825                    b.HasIndex("ParentId", "ChildType");
 27826
 27827                    b.HasIndex("ParentId", "SortOrder");
 27828
 27829                    b.ToTable("LinkedChildren", (string)null);
 27830
 27831                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27832                });
 833
 27834            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaSegment", b =>
 27835                {
 27836                    b.Property<Guid>("Id")
 27837                        .ValueGeneratedOnAdd()
 27838                        .HasColumnType("TEXT");
 27839
 27840                    b.Property<long>("EndTicks")
 27841                        .HasColumnType("INTEGER");
 27842
 27843                    b.Property<Guid>("ItemId")
 27844                        .HasColumnType("TEXT");
 27845
 27846                    b.Property<string>("SegmentProviderId")
 27847                        .IsRequired()
 27848                        .HasColumnType("TEXT");
 27849
 27850                    b.Property<long>("StartTicks")
 27851                        .HasColumnType("INTEGER");
 27852
 27853                    b.Property<int>("Type")
 27854                        .HasColumnType("INTEGER");
 27855
 27856                    b.HasKey("Id");
 27857
 27858                    b.ToTable("MediaSegments");
 27859
 27860                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27861                });
 862
 27863            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 27864                {
 27865                    b.Property<Guid>("ItemId")
 27866                        .HasColumnType("TEXT");
 27867
 27868                    b.Property<int>("StreamIndex")
 27869                        .HasColumnType("INTEGER");
 27870
 27871                    b.Property<string>("AspectRatio")
 27872                        .HasColumnType("TEXT");
 27873
 27874                    b.Property<float?>("AverageFrameRate")
 27875                        .HasColumnType("REAL");
 27876
 27877                    b.Property<int?>("BitDepth")
 27878                        .HasColumnType("INTEGER");
 27879
 27880                    b.Property<int?>("BitRate")
 27881                        .HasColumnType("INTEGER");
 27882
 27883                    b.Property<int?>("BlPresentFlag")
 27884                        .HasColumnType("INTEGER");
 27885
 27886                    b.Property<string>("ChannelLayout")
 27887                        .HasColumnType("TEXT");
 27888
 27889                    b.Property<int?>("Channels")
 27890                        .HasColumnType("INTEGER");
 27891
 27892                    b.Property<string>("Codec")
 27893                        .HasColumnType("TEXT");
 27894
 27895                    b.Property<string>("CodecTag")
 27896                        .HasColumnType("TEXT");
 27897
 27898                    b.Property<string>("CodecTimeBase")
 27899                        .HasColumnType("TEXT");
 27900
 27901                    b.Property<string>("ColorPrimaries")
 27902                        .HasColumnType("TEXT");
 27903
 27904                    b.Property<string>("ColorSpace")
 27905                        .HasColumnType("TEXT");
 27906
 27907                    b.Property<string>("ColorTransfer")
 27908                        .HasColumnType("TEXT");
 27909
 27910                    b.Property<string>("Comment")
 27911                        .HasColumnType("TEXT");
 27912
 27913                    b.Property<int?>("DvBlSignalCompatibilityId")
 27914                        .HasColumnType("INTEGER");
 27915
 27916                    b.Property<int?>("DvLevel")
 27917                        .HasColumnType("INTEGER");
 27918
 27919                    b.Property<int?>("DvProfile")
 27920                        .HasColumnType("INTEGER");
 27921
 27922                    b.Property<int?>("DvVersionMajor")
 27923                        .HasColumnType("INTEGER");
 27924
 27925                    b.Property<int?>("DvVersionMinor")
 27926                        .HasColumnType("INTEGER");
 27927
 27928                    b.Property<int?>("ElPresentFlag")
 27929                        .HasColumnType("INTEGER");
 27930
 27931                    b.Property<bool?>("Hdr10PlusPresentFlag")
 27932                        .HasColumnType("INTEGER");
 27933
 27934                    b.Property<int?>("Height")
 27935                        .HasColumnType("INTEGER");
 27936
 27937                    b.Property<bool?>("IsAnamorphic")
 27938                        .HasColumnType("INTEGER");
 27939
 27940                    b.Property<bool?>("IsAvc")
 27941                        .HasColumnType("INTEGER");
 27942
 27943                    b.Property<bool>("IsDefault")
 27944                        .HasColumnType("INTEGER");
 27945
 27946                    b.Property<bool>("IsExternal")
 27947                        .HasColumnType("INTEGER");
 27948
 27949                    b.Property<bool>("IsForced")
 27950                        .HasColumnType("INTEGER");
 27951
 27952                    b.Property<bool?>("IsHearingImpaired")
 27953                        .HasColumnType("INTEGER");
 27954
 27955                    b.Property<bool?>("IsInterlaced")
 27956                        .HasColumnType("INTEGER");
 27957
 27958                    b.Property<bool>("IsOriginal")
 27959                        .HasColumnType("INTEGER");
 27960
 27961                    b.Property<string>("KeyFrames")
 27962                        .HasColumnType("TEXT");
 27963
 27964                    b.Property<string>("Language")
 27965                        .HasColumnType("TEXT");
 27966
 27967                    b.Property<float?>("Level")
 27968                        .HasColumnType("REAL");
 27969
 27970                    b.Property<string>("NalLengthSize")
 27971                        .HasColumnType("TEXT");
 27972
 27973                    b.Property<string>("Path")
 27974                        .HasColumnType("TEXT");
 27975
 27976                    b.Property<string>("PixelFormat")
 27977                        .HasColumnType("TEXT");
 27978
 27979                    b.Property<string>("Profile")
 27980                        .HasColumnType("TEXT");
 27981
 27982                    b.Property<float?>("RealFrameRate")
 27983                        .HasColumnType("REAL");
 27984
 27985                    b.Property<int?>("RefFrames")
 27986                        .HasColumnType("INTEGER");
 27987
 27988                    b.Property<int?>("Rotation")
 27989                        .HasColumnType("INTEGER");
 27990
 27991                    b.Property<int?>("RpuPresentFlag")
 27992                        .HasColumnType("INTEGER");
 27993
 27994                    b.Property<int?>("SampleRate")
 27995                        .HasColumnType("INTEGER");
 27996
 27997                    b.Property<int>("StreamType")
 27998                        .HasColumnType("INTEGER");
 27999
 271000                    b.Property<string>("TimeBase")
 271001                        .HasColumnType("TEXT");
 271002
 271003                    b.Property<string>("Title")
 271004                        .HasColumnType("TEXT");
 271005
 271006                    b.Property<int?>("Width")
 271007                        .HasColumnType("INTEGER");
 271008
 271009                    b.HasKey("ItemId", "StreamIndex");
 271010
 271011                    b.HasIndex("StreamIndex");
 271012
 271013                    b.HasIndex("StreamType");
 271014
 271015                    b.HasIndex("StreamIndex", "StreamType");
 271016
 271017                    b.HasIndex("StreamIndex", "StreamType", "Language");
 271018
 271019                    b.ToTable("MediaStreamInfos");
 271020
 271021                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271022                });
 1023
 271024            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 271025                {
 271026                    b.Property<Guid>("Id")
 271027                        .ValueGeneratedOnAdd()
 271028                        .HasColumnType("TEXT");
 271029
 271030                    b.Property<string>("Name")
 271031                        .IsRequired()
 271032                        .HasColumnType("TEXT");
 271033
 271034                    b.Property<string>("PersonType")
 271035                        .HasColumnType("TEXT");
 271036
 271037                    b.HasKey("Id");
 271038
 271039                    b.HasIndex("Name");
 271040
 271041                    b.ToTable("Peoples");
 271042
 271043                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271044                });
 1045
 271046            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 271047                {
 271048                    b.Property<Guid>("ItemId")
 271049                        .HasColumnType("TEXT");
 271050
 271051                    b.Property<Guid>("PeopleId")
 271052                        .HasColumnType("TEXT");
 271053
 271054                    b.Property<string>("Role")
 271055                        .HasColumnType("TEXT");
 271056
 271057                    b.Property<int?>("ListOrder")
 271058                        .HasColumnType("INTEGER");
 271059
 271060                    b.Property<int?>("SortOrder")
 271061                        .HasColumnType("INTEGER");
 271062
 271063                    b.HasKey("ItemId", "PeopleId", "Role");
 271064
 271065                    b.HasIndex("PeopleId");
 271066
 271067                    b.HasIndex("ItemId", "ListOrder");
 271068
 271069                    b.HasIndex("ItemId", "SortOrder");
 271070
 271071                    b.ToTable("PeopleBaseItemMap");
 271072
 271073                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271074                });
 1075
 271076            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 271077                {
 271078                    b.Property<int>("Id")
 271079                        .ValueGeneratedOnAdd()
 271080                        .HasColumnType("INTEGER");
 271081
 271082                    b.Property<int>("Kind")
 271083                        .HasColumnType("INTEGER");
 271084
 271085                    b.Property<Guid?>("Permission_Permissions_Guid")
 271086                        .HasColumnType("TEXT");
 271087
 271088                    b.Property<uint>("RowVersion")
 271089                        .IsConcurrencyToken()
 271090                        .HasColumnType("INTEGER");
 271091
 271092                    b.Property<Guid?>("UserId")
 271093                        .HasColumnType("TEXT");
 271094
 271095                    b.Property<bool>("Value")
 271096                        .HasColumnType("INTEGER");
 271097
 271098                    b.HasKey("Id");
 271099
 271100                    b.HasIndex("UserId", "Kind")
 271101                        .IsUnique()
 271102                        .HasFilter("[UserId] IS NOT NULL");
 271103
 271104                    b.ToTable("Permissions");
 271105
 271106                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271107                });
 1108
 271109            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 271110                {
 271111                    b.Property<int>("Id")
 271112                        .ValueGeneratedOnAdd()
 271113                        .HasColumnType("INTEGER");
 271114
 271115                    b.Property<int>("Kind")
 271116                        .HasColumnType("INTEGER");
 271117
 271118                    b.Property<Guid?>("Preference_Preferences_Guid")
 271119                        .HasColumnType("TEXT");
 271120
 271121                    b.Property<uint>("RowVersion")
 271122                        .IsConcurrencyToken()
 271123                        .HasColumnType("INTEGER");
 271124
 271125                    b.Property<Guid?>("UserId")
 271126                        .HasColumnType("TEXT");
 271127
 271128                    b.Property<string>("Value")
 271129                        .IsRequired()
 271130                        .HasMaxLength(65535)
 271131                        .HasColumnType("TEXT");
 271132
 271133                    b.HasKey("Id");
 271134
 271135                    b.HasIndex("UserId", "Kind")
 271136                        .IsUnique()
 271137                        .HasFilter("[UserId] IS NOT NULL");
 271138
 271139                    b.ToTable("Preferences");
 271140
 271141                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271142                });
 1143
 271144            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.ApiKey", b =>
 271145                {
 271146                    b.Property<int>("Id")
 271147                        .ValueGeneratedOnAdd()
 271148                        .HasColumnType("INTEGER");
 271149
 271150                    b.Property<string>("AccessToken")
 271151                        .IsRequired()
 271152                        .HasColumnType("TEXT");
 271153
 271154                    b.Property<DateTime>("DateCreated")
 271155                        .HasColumnType("TEXT");
 271156
 271157                    b.Property<DateTime>("DateLastActivity")
 271158                        .HasColumnType("TEXT");
 271159
 271160                    b.Property<string>("Name")
 271161                        .IsRequired()
 271162                        .HasMaxLength(64)
 271163                        .HasColumnType("TEXT");
 271164
 271165                    b.HasKey("Id");
 271166
 271167                    b.HasIndex("AccessToken")
 271168                        .IsUnique();
 271169
 271170                    b.ToTable("ApiKeys");
 271171
 271172                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271173                });
 1174
 271175            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 271176                {
 271177                    b.Property<int>("Id")
 271178                        .ValueGeneratedOnAdd()
 271179                        .HasColumnType("INTEGER");
 271180
 271181                    b.Property<string>("AccessToken")
 271182                        .IsRequired()
 271183                        .HasColumnType("TEXT");
 271184
 271185                    b.Property<string>("AppName")
 271186                        .IsRequired()
 271187                        .HasMaxLength(64)
 271188                        .HasColumnType("TEXT");
 271189
 271190                    b.Property<string>("AppVersion")
 271191                        .IsRequired()
 271192                        .HasMaxLength(32)
 271193                        .HasColumnType("TEXT");
 271194
 271195                    b.Property<DateTime>("DateCreated")
 271196                        .HasColumnType("TEXT");
 271197
 271198                    b.Property<DateTime>("DateLastActivity")
 271199                        .HasColumnType("TEXT");
 271200
 271201                    b.Property<DateTime>("DateModified")
 271202                        .HasColumnType("TEXT");
 271203
 271204                    b.Property<string>("DeviceId")
 271205                        .IsRequired()
 271206                        .HasMaxLength(256)
 271207                        .HasColumnType("TEXT");
 271208
 271209                    b.Property<string>("DeviceName")
 271210                        .IsRequired()
 271211                        .HasMaxLength(64)
 271212                        .HasColumnType("TEXT");
 271213
 271214                    b.Property<bool>("IsActive")
 271215                        .HasColumnType("INTEGER");
 271216
 271217                    b.Property<Guid>("UserId")
 271218                        .HasColumnType("TEXT");
 271219
 271220                    b.HasKey("Id");
 271221
 271222                    b.HasIndex("DeviceId");
 271223
 271224                    b.HasIndex("AccessToken", "DateLastActivity");
 271225
 271226                    b.HasIndex("DeviceId", "DateLastActivity");
 271227
 271228                    b.HasIndex("UserId", "DeviceId");
 271229
 271230                    b.ToTable("Devices");
 271231
 271232                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271233                });
 1234
 271235            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.DeviceOptions", b =>
 271236                {
 271237                    b.Property<int>("Id")
 271238                        .ValueGeneratedOnAdd()
 271239                        .HasColumnType("INTEGER");
 271240
 271241                    b.Property<string>("CustomName")
 271242                        .HasColumnType("TEXT");
 271243
 271244                    b.Property<string>("DeviceId")
 271245                        .IsRequired()
 271246                        .HasColumnType("TEXT");
 271247
 271248                    b.HasKey("Id");
 271249
 271250                    b.HasIndex("DeviceId")
 271251                        .IsUnique();
 271252
 271253                    b.ToTable("DeviceOptions");
 271254
 271255                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271256                });
 1257
 271258            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.TrickplayInfo", b =>
 271259                {
 271260                    b.Property<Guid>("ItemId")
 271261                        .HasColumnType("TEXT");
 271262
 271263                    b.Property<int>("Width")
 271264                        .HasColumnType("INTEGER");
 271265
 271266                    b.Property<int>("Bandwidth")
 271267                        .HasColumnType("INTEGER");
 271268
 271269                    b.Property<int>("Height")
 271270                        .HasColumnType("INTEGER");
 271271
 271272                    b.Property<int>("Interval")
 271273                        .HasColumnType("INTEGER");
 271274
 271275                    b.Property<int>("ThumbnailCount")
 271276                        .HasColumnType("INTEGER");
 271277
 271278                    b.Property<int>("TileHeight")
 271279                        .HasColumnType("INTEGER");
 271280
 271281                    b.Property<int>("TileWidth")
 271282                        .HasColumnType("INTEGER");
 271283
 271284                    b.HasKey("ItemId", "Width");
 271285
 271286                    b.ToTable("TrickplayInfos");
 271287
 271288                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271289                });
 1290
 271291            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 271292                {
 271293                    b.Property<Guid>("Id")
 271294                        .ValueGeneratedOnAdd()
 271295                        .HasColumnType("TEXT");
 271296
 271297                    b.Property<string>("AudioLanguagePreference")
 271298                        .HasMaxLength(255)
 271299                        .HasColumnType("TEXT");
 271300
 271301                    b.Property<string>("AuthenticationProviderId")
 271302                        .IsRequired()
 271303                        .HasMaxLength(255)
 271304                        .HasColumnType("TEXT");
 271305
 271306                    b.Property<string>("CastReceiverId")
 271307                        .HasMaxLength(32)
 271308                        .HasColumnType("TEXT");
 271309
 271310                    b.Property<bool>("DisplayCollectionsView")
 271311                        .HasColumnType("INTEGER");
 271312
 271313                    b.Property<bool>("DisplayMissingEpisodes")
 271314                        .HasColumnType("INTEGER");
 271315
 271316                    b.Property<bool>("EnableAutoLogin")
 271317                        .HasColumnType("INTEGER");
 271318
 271319                    b.Property<bool>("EnableLocalPassword")
 271320                        .HasColumnType("INTEGER");
 271321
 271322                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 271323                        .HasColumnType("INTEGER");
 271324
 271325                    b.Property<bool>("EnableUserPreferenceAccess")
 271326                        .HasColumnType("INTEGER");
 271327
 271328                    b.Property<bool>("HidePlayedInLatest")
 271329                        .HasColumnType("INTEGER");
 271330
 271331                    b.Property<long>("InternalId")
 271332                        .HasColumnType("INTEGER");
 271333
 271334                    b.Property<int>("InvalidLoginAttemptCount")
 271335                        .HasColumnType("INTEGER");
 271336
 271337                    b.Property<DateTime?>("LastActivityDate")
 271338                        .HasColumnType("TEXT");
 271339
 271340                    b.Property<DateTime?>("LastLoginDate")
 271341                        .HasColumnType("TEXT");
 271342
 271343                    b.Property<int?>("LoginAttemptsBeforeLockout")
 271344                        .HasColumnType("INTEGER");
 271345
 271346                    b.Property<int>("MaxActiveSessions")
 271347                        .HasColumnType("INTEGER");
 271348
 271349                    b.Property<int?>("MaxParentalRatingScore")
 271350                        .HasColumnType("INTEGER");
 271351
 271352                    b.Property<int?>("MaxParentalRatingSubScore")
 271353                        .HasColumnType("INTEGER");
 271354
 271355                    b.Property<bool>("MustUpdatePassword")
 271356                        .HasColumnType("INTEGER");
 271357
 271358                    b.Property<string>("Password")
 271359                        .HasMaxLength(65535)
 271360                        .HasColumnType("TEXT");
 271361
 271362                    b.Property<string>("PasswordResetProviderId")
 271363                        .IsRequired()
 271364                        .HasMaxLength(255)
 271365                        .HasColumnType("TEXT");
 271366
 271367                    b.Property<bool>("PlayDefaultAudioTrack")
 271368                        .HasColumnType("INTEGER");
 271369
 271370                    b.Property<bool>("RememberAudioSelections")
 271371                        .HasColumnType("INTEGER");
 271372
 271373                    b.Property<bool>("RememberSubtitleSelections")
 271374                        .HasColumnType("INTEGER");
 271375
 271376                    b.Property<int?>("RemoteClientBitrateLimit")
 271377                        .HasColumnType("INTEGER");
 271378
 271379                    b.Property<uint>("RowVersion")
 271380                        .IsConcurrencyToken()
 271381                        .HasColumnType("INTEGER");
 271382
 271383                    b.Property<string>("SubtitleLanguagePreference")
 271384                        .HasMaxLength(255)
 271385                        .HasColumnType("TEXT");
 271386
 271387                    b.Property<int>("SubtitleMode")
 271388                        .HasColumnType("INTEGER");
 271389
 271390                    b.Property<int>("SyncPlayAccess")
 271391                        .HasColumnType("INTEGER");
 271392
 271393                    b.Property<string>("Username")
 271394                        .IsRequired()
 271395                        .HasMaxLength(255)
 271396                        .HasColumnType("TEXT");
 271397
 271398                    b.HasKey("Id");
 271399
 271400                    b.HasIndex("Username")
 271401                        .IsUnique();
 271402
 271403                    b.ToTable("Users");
 271404
 271405                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271406                });
 1407
 271408            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 271409                {
 271410                    b.Property<Guid>("ItemId")
 271411                        .HasColumnType("TEXT");
 271412
 271413                    b.Property<Guid>("UserId")
 271414                        .HasColumnType("TEXT");
 271415
 271416                    b.Property<string>("CustomDataKey")
 271417                        .HasColumnType("TEXT");
 271418
 271419                    b.Property<int?>("AudioStreamIndex")
 271420                        .HasColumnType("INTEGER");
 271421
 271422                    b.Property<bool>("IsFavorite")
 271423                        .HasColumnType("INTEGER");
 271424
 271425                    b.Property<DateTime?>("LastPlayedDate")
 271426                        .HasColumnType("TEXT");
 271427
 271428                    b.Property<bool?>("Likes")
 271429                        .HasColumnType("INTEGER");
 271430
 271431                    b.Property<int>("PlayCount")
 271432                        .HasColumnType("INTEGER");
 271433
 271434                    b.Property<long>("PlaybackPositionTicks")
 271435                        .HasColumnType("INTEGER");
 271436
 271437                    b.Property<bool>("Played")
 271438                        .HasColumnType("INTEGER");
 271439
 271440                    b.Property<double?>("Rating")
 271441                        .HasColumnType("REAL");
 271442
 271443                    b.Property<DateTime?>("RetentionDate")
 271444                        .HasColumnType("TEXT");
 271445
 271446                    b.Property<int?>("SubtitleStreamIndex")
 271447                        .HasColumnType("INTEGER");
 271448
 271449                    b.HasKey("ItemId", "UserId", "CustomDataKey");
 271450
 271451                    b.HasIndex("UserId");
 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.ToTable("UserData");
 271462
 271463                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271464                });
 1465
 271466            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 271467                {
 271468                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271469                        .WithMany("AccessSchedules")
 271470                        .HasForeignKey("UserId")
 271471                        .OnDelete(DeleteBehavior.Cascade)
 271472                        .IsRequired();
 271473                });
 1474
 271475            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 271476                {
 271477                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271478                        .WithMany("Parents")
 271479                        .HasForeignKey("ItemId")
 271480                        .OnDelete(DeleteBehavior.Cascade)
 271481                        .IsRequired();
 271482
 271483                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "ParentItem")
 271484                        .WithMany("Children")
 271485                        .HasForeignKey("ParentItemId")
 271486                        .OnDelete(DeleteBehavior.Cascade)
 271487                        .IsRequired();
 271488
 271489                    b.Navigation("Item");
 271490
 271491                    b.Navigation("ParentItem");
 271492                });
 1493
 271494            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 271495                {
 271496                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271497                        .WithMany()
 271498                        .HasForeignKey("ItemId")
 271499                        .OnDelete(DeleteBehavior.Cascade)
 271500                        .IsRequired();
 271501
 271502                    b.Navigation("Item");
 271503                });
 1504
 271505            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 271506                {
 271507                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Owner")
 271508                        .WithMany("Extras")
 271509                        .HasForeignKey("OwnerId")
 271510                        .OnDelete(DeleteBehavior.NoAction);
 271511
 271512                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "DirectParent")
 271513                        .WithMany("DirectChildren")
 271514                        .HasForeignKey("ParentId")
 271515                        .OnDelete(DeleteBehavior.Cascade);
 271516
 271517                    b.Navigation("DirectParent");
 271518
 271519                    b.Navigation("Owner");
 271520                });
 1521
 271522            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 271523                {
 271524                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271525                        .WithMany("Images")
 271526                        .HasForeignKey("ItemId")
 271527                        .OnDelete(DeleteBehavior.Cascade)
 271528                        .IsRequired();
 271529
 271530                    b.Navigation("Item");
 271531                });
 1532
 271533            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 271534                {
 271535                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271536                        .WithMany("LockedFields")
 271537                        .HasForeignKey("ItemId")
 271538                        .OnDelete(DeleteBehavior.Cascade)
 271539                        .IsRequired();
 271540
 271541                    b.Navigation("Item");
 271542                });
 1543
 271544            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 271545                {
 271546                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271547                        .WithMany("Provider")
 271548                        .HasForeignKey("ItemId")
 271549                        .OnDelete(DeleteBehavior.Cascade)
 271550                        .IsRequired();
 271551
 271552                    b.Navigation("Item");
 271553                });
 1554
 271555            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 271556                {
 271557                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271558                        .WithMany("TrailerTypes")
 271559                        .HasForeignKey("ItemId")
 271560                        .OnDelete(DeleteBehavior.Cascade)
 271561                        .IsRequired();
 271562
 271563                    b.Navigation("Item");
 271564                });
 1565
 271566            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 271567                {
 271568                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271569                        .WithMany("Chapters")
 271570                        .HasForeignKey("ItemId")
 271571                        .OnDelete(DeleteBehavior.Cascade)
 271572                        .IsRequired();
 271573
 271574                    b.Navigation("Item");
 271575                });
 1576
 271577            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 271578                {
 271579                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271580                        .WithMany("DisplayPreferences")
 271581                        .HasForeignKey("UserId")
 271582                        .OnDelete(DeleteBehavior.Cascade)
 271583                        .IsRequired();
 271584                });
 1585
 271586            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 271587                {
 271588                    b.HasOne("Jellyfin.Database.Implementations.Entities.DisplayPreferences", null)
 271589                        .WithMany("HomeSections")
 271590                        .HasForeignKey("DisplayPreferencesId")
 271591                        .OnDelete(DeleteBehavior.Cascade)
 271592                        .IsRequired();
 271593                });
 1594
 271595            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 271596                {
 271597                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271598                        .WithOne("ProfileImage")
 271599                        .HasForeignKey("Jellyfin.Database.Implementations.Entities.ImageInfo", "UserId")
 271600                        .OnDelete(DeleteBehavior.Cascade);
 271601                });
 1602
 271603            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 271604                {
 271605                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271606                        .WithMany("ItemDisplayPreferences")
 271607                        .HasForeignKey("UserId")
 271608                        .OnDelete(DeleteBehavior.Cascade)
 271609                        .IsRequired();
 271610                });
 1611
 271612            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 271613                {
 271614                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271615                        .WithMany("ItemValues")
 271616                        .HasForeignKey("ItemId")
 271617                        .OnDelete(DeleteBehavior.Cascade)
 271618                        .IsRequired();
 271619
 271620                    b.HasOne("Jellyfin.Database.Implementations.Entities.ItemValue", "ItemValue")
 271621                        .WithMany("BaseItemsMap")
 271622                        .HasForeignKey("ItemValueId")
 271623                        .OnDelete(DeleteBehavior.Cascade)
 271624                        .IsRequired();
 271625
 271626                    b.Navigation("Item");
 271627
 271628                    b.Navigation("ItemValue");
 271629                });
 1630
 271631            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 271632                {
 271633                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271634                        .WithMany()
 271635                        .HasForeignKey("ItemId")
 271636                        .OnDelete(DeleteBehavior.Cascade)
 271637                        .IsRequired();
 271638
 271639                    b.Navigation("Item");
 271640                });
 1641
 271642            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 271643                {
 271644                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Child")
 271645                        .WithMany("LinkedChildOfEntities")
 271646                        .HasForeignKey("ChildId")
 271647                        .OnDelete(DeleteBehavior.NoAction)
 271648                        .IsRequired();
 271649
 271650                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Parent")
 271651                        .WithMany("LinkedChildEntities")
 271652                        .HasForeignKey("ParentId")
 271653                        .OnDelete(DeleteBehavior.NoAction)
 271654                        .IsRequired();
 271655
 271656                    b.Navigation("Child");
 271657
 271658                    b.Navigation("Parent");
 271659                });
 1660
 271661            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 271662                {
 271663                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271664                        .WithMany("MediaStreams")
 271665                        .HasForeignKey("ItemId")
 271666                        .OnDelete(DeleteBehavior.Cascade)
 271667                        .IsRequired();
 271668
 271669                    b.Navigation("Item");
 271670                });
 1671
 271672            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 271673                {
 271674                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271675                        .WithMany("Peoples")
 271676                        .HasForeignKey("ItemId")
 271677                        .OnDelete(DeleteBehavior.Cascade)
 271678                        .IsRequired();
 271679
 271680                    b.HasOne("Jellyfin.Database.Implementations.Entities.People", "People")
 271681                        .WithMany("BaseItems")
 271682                        .HasForeignKey("PeopleId")
 271683                        .OnDelete(DeleteBehavior.Cascade)
 271684                        .IsRequired();
 271685
 271686                    b.Navigation("Item");
 271687
 271688                    b.Navigation("People");
 271689                });
 1690
 271691            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 271692                {
 271693                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271694                        .WithMany("Permissions")
 271695                        .HasForeignKey("UserId")
 271696                        .OnDelete(DeleteBehavior.Cascade);
 271697                });
 1698
 271699            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 271700                {
 271701                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271702                        .WithMany("Preferences")
 271703                        .HasForeignKey("UserId")
 271704                        .OnDelete(DeleteBehavior.Cascade);
 271705                });
 1706
 271707            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 271708                {
 271709                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 271710                        .WithMany()
 271711                        .HasForeignKey("UserId")
 271712                        .OnDelete(DeleteBehavior.Cascade)
 271713                        .IsRequired();
 271714
 271715                    b.Navigation("User");
 271716                });
 1717
 271718            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 271719                {
 271720                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271721                        .WithMany("UserData")
 271722                        .HasForeignKey("ItemId")
 271723                        .OnDelete(DeleteBehavior.Cascade)
 271724                        .IsRequired();
 271725
 271726                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 271727                        .WithMany()
 271728                        .HasForeignKey("UserId")
 271729                        .OnDelete(DeleteBehavior.Cascade)
 271730                        .IsRequired();
 271731
 271732                    b.Navigation("Item");
 271733
 271734                    b.Navigation("User");
 271735                });
 1736
 271737            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 271738                {
 271739                    b.Navigation("Chapters");
 271740
 271741                    b.Navigation("Children");
 271742
 271743                    b.Navigation("DirectChildren");
 271744
 271745                    b.Navigation("Extras");
 271746
 271747                    b.Navigation("Images");
 271748
 271749                    b.Navigation("ItemValues");
 271750
 271751                    b.Navigation("LinkedChildEntities");
 271752
 271753                    b.Navigation("LinkedChildOfEntities");
 271754
 271755                    b.Navigation("LockedFields");
 271756
 271757                    b.Navigation("MediaStreams");
 271758
 271759                    b.Navigation("Parents");
 271760
 271761                    b.Navigation("Peoples");
 271762
 271763                    b.Navigation("Provider");
 271764
 271765                    b.Navigation("TrailerTypes");
 271766
 271767                    b.Navigation("UserData");
 271768                });
 1769
 271770            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 271771                {
 271772                    b.Navigation("HomeSections");
 271773                });
 1774
 271775            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 271776                {
 271777                    b.Navigation("BaseItemsMap");
 271778                });
 1779
 271780            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 271781                {
 271782                    b.Navigation("BaseItems");
 271783                });
 1784
 271785            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 271786                {
 271787                    b.Navigation("AccessSchedules");
 271788
 271789                    b.Navigation("DisplayPreferences");
 271790
 271791                    b.Navigation("ItemDisplayPreferences");
 271792
 271793                    b.Navigation("Permissions");
 271794
 271795                    b.Navigation("Preferences");
 271796
 271797                    b.Navigation("ProfileImage");
 271798                });
 1799#pragma warning restore 612, 618
 271800        }
 1801    }
 1802}