< Summary - Jellyfin

Line coverage
97%
Covered lines: 1822
Uncovered lines: 44
Coverable lines: 1866
Total lines: 1990
Line coverage: 97.6%
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: 97.5% (1783/1827) Total lines: 195410/29/2026 - 12:17:11 AM Line coverage: 97.6% (1822/1866) Total lines: 1990

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/20260113203012_ChangeOwnerIdToGuid.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 ChangeOwnerIdToGuid : Migration
 10    {
 11        /// <inheritdoc />
 12        protected override void Up(MigrationBuilder migrationBuilder)
 13        {
 2714            migrationBuilder.Sql(
 2715                """
 2716                DROP TABLE IF EXISTS "OrphanedBaseItemIds";
 2717                CREATE TEMPORARY TABLE "OrphanedBaseItemIds" ("Id" TEXT NOT NULL PRIMARY KEY);
 2718
 2719                INSERT INTO "OrphanedBaseItemIds" ("Id")
 2720                WITH RECURSIVE Orphan ("Id") AS (
 2721                    SELECT Child."Id"
 2722                    FROM "BaseItems" AS Child
 2723                    WHERE Child."ParentId" IS NOT NULL
 2724                      AND NOT EXISTS (SELECT 1 FROM "BaseItems" AS Parent WHERE Parent."Id" = Child."ParentId")
 2725                    UNION
 2726                    SELECT Descendant."Id"
 2727                    FROM "BaseItems" AS Descendant
 2728                    INNER JOIN Orphan ON Descendant."ParentId" = Orphan."Id"
 2729                )
 2730                SELECT "Id" FROM Orphan;
 2731
 2732                -- Keep the play state of the doomed items the way ItemPersistenceService does when it
 2733                -- deletes an item: reattach it to the placeholder item instead of letting the
 2734                -- FK_UserData_BaseItems_ItemId cascade wipe it. The placeholder can only hold one row
 2735                -- per (UserId, CustomDataKey), so resolve collisions before repointing anything.
 2736                DROP TABLE IF EXISTS "DoomedUserDataKeys";
 2737                CREATE TEMPORARY TABLE "DoomedUserDataKeys" (
 2738                    "UserId" TEXT NOT NULL,
 2739                    "CustomDataKey" TEXT NOT NULL,
 2740                    PRIMARY KEY ("UserId", "CustomDataKey"));
 2741
 2742                -- Collect the colliding keys up front: correlating against "UserData" directly makes
 2743                -- the delete below re-scan every row of that user once per placeholder row.
 2744                INSERT OR IGNORE INTO "DoomedUserDataKeys" ("UserId", "CustomDataKey")
 2745                SELECT Doomed."UserId", Doomed."CustomDataKey"
 2746                FROM "UserData" AS Doomed
 2747                INNER JOIN "OrphanedBaseItemIds" AS Orphan ON Orphan."Id" = Doomed."ItemId";
 2748
 2749                DELETE FROM "UserData"
 2750                WHERE "ItemId" = '00000000-0000-0000-0000-000000000001'
 2751                  AND EXISTS (
 2752                      SELECT 1
 2753                      FROM "DoomedUserDataKeys" AS Doomed
 2754                      WHERE Doomed."UserId" = "UserData"."UserId"
 2755                        AND Doomed."CustomDataKey" = "UserData"."CustomDataKey");
 2756
 2757                DELETE FROM "UserData"
 2758                WHERE "ItemId" IN (SELECT "Id" FROM "OrphanedBaseItemIds")
 2759                  AND "rowid" NOT IN (
 2760                      SELECT MIN("rowid")
 2761                      FROM "UserData"
 2762                      WHERE "ItemId" IN (SELECT "Id" FROM "OrphanedBaseItemIds")
 2763                      GROUP BY "UserId", "CustomDataKey");
 2764
 2765                UPDATE "UserData"
 2766                SET "ItemId" = '00000000-0000-0000-0000-000000000001',
 2767                    "RetentionDate" = datetime('now')
 2768                WHERE "ItemId" IN (SELECT "Id" FROM "OrphanedBaseItemIds");
 2769
 2770                -- FK_LinkedChildren_BaseItems_{ParentId,ChildId} are NO ACTION, so these rows have to
 2771                -- go by hand or the delete below fails on them.
 2772                DELETE FROM "LinkedChildren"
 2773                WHERE "ParentId" IN (SELECT "Id" FROM "OrphanedBaseItemIds")
 2774                   OR "ChildId" IN (SELECT "Id" FROM "OrphanedBaseItemIds");
 2775
 2776                DELETE FROM "BaseItems" WHERE "Id" IN (SELECT "Id" FROM "OrphanedBaseItemIds");
 2777
 2778                DROP TABLE "DoomedUserDataKeys";
 2779                DROP TABLE "OrphanedBaseItemIds";
 2780                """);
 81
 82            // Normalize OwnerId to uppercase GUID format
 2783            migrationBuilder.Sql(
 2784                @"UPDATE BaseItems
 2785                  SET OwnerId = UPPER(OwnerId)
 2786                  WHERE OwnerId IS NOT NULL");
 87
 88            // Clear invalid OwnerId values (not 36 characters = not a valid GUID)
 2789            migrationBuilder.Sql(
 2790                @"UPDATE BaseItems
 2791                  SET OwnerId = null
 2792                  WHERE OwnerId IS NOT NULL AND length(OwnerId) != 36");
 93
 94            // Clear placeholder/empty GUIDs
 2795            migrationBuilder.UpdateData(
 2796                table: "BaseItems",
 2797                keyColumn: "OwnerId",
 2798                keyValue: new Guid("00000000-0000-0000-0000-000000000000"),
 2799                column: "OwnerId",
 27100                value: null);
 101
 27102            migrationBuilder.UpdateData(
 27103                table: "BaseItems",
 27104                keyColumn: "OwnerId",
 27105                keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
 27106                column: "OwnerId",
 27107                value: null);
 108
 27109            migrationBuilder.AddColumn<Guid>(
 27110                name: "BaseItemEntityId",
 27111                table: "BaseItems",
 27112                type: "TEXT",
 27113                nullable: true);
 114
 27115            migrationBuilder.UpdateData(
 27116                table: "BaseItems",
 27117                keyColumn: "Id",
 27118                keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
 27119                columns: new[] { "BaseItemEntityId", "Name", "OwnerId" },
 27120                values: new object[] { null, "This is a placeholder item for UserData that has been detached from its or
 121
 122            // No CreateIndex calls here on purpose: AddForeignKey rebuilds BaseItems on SQLite and
 123            // recreates every index of the target model afterwards, so building them first only
 124            // pays for a full index pass that the rebuild immediately throws away.
 27125            migrationBuilder.AddForeignKey(
 27126                name: "FK_BaseItems_BaseItems_BaseItemEntityId",
 27127                table: "BaseItems",
 27128                column: "BaseItemEntityId",
 27129                principalTable: "BaseItems",
 27130                principalColumn: "Id");
 27131        }
 132
 133        /// <inheritdoc />
 134        protected override void Down(MigrationBuilder migrationBuilder)
 135        {
 0136            migrationBuilder.UpdateData(
 0137                table: "BaseItems",
 0138                keyColumn: "Id",
 0139                keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
 0140                column: "OwnerId",
 0141                value: null);
 142
 0143            migrationBuilder.Sql(
 0144                @"UPDATE BaseItems
 0145                  SET OwnerId = LOWER(OwnerId)
 0146                  WHERE OwnerId IS NOT NULL");
 147
 0148            migrationBuilder.DropForeignKey(
 0149                name: "FK_BaseItems_BaseItems_BaseItemEntityId",
 0150                table: "BaseItems");
 151
 0152            migrationBuilder.DropIndex(
 0153                name: "IX_BaseItems_BaseItemEntityId",
 0154                table: "BaseItems");
 155
 0156            migrationBuilder.DropIndex(
 0157                name: "IX_BaseItems_ExtraType",
 0158                table: "BaseItems");
 159
 0160            migrationBuilder.DropIndex(
 0161                name: "IX_BaseItems_ExtraType_OwnerId",
 0162                table: "BaseItems");
 163
 0164            migrationBuilder.DropIndex(
 0165                name: "IX_BaseItems_OwnerId",
 0166                table: "BaseItems");
 167
 0168            migrationBuilder.DropIndex(
 0169                name: "IX_BaseItems_TopParentId_IsFolder_IsVirtualItem_DateCreated",
 0170                table: "BaseItems");
 171
 0172            migrationBuilder.DropIndex(
 0173                name: "IX_BaseItems_TopParentId_MediaType_IsVirtualItem_DateCreated",
 0174                table: "BaseItems");
 175
 0176            migrationBuilder.DropIndex(
 0177                name: "IX_BaseItems_TopParentId_Type_IsVirtualItem_DateCreated",
 0178                table: "BaseItems");
 179
 0180            migrationBuilder.DropColumn(
 0181                name: "BaseItemEntityId",
 0182                table: "BaseItems");
 183
 0184            migrationBuilder.UpdateData(
 0185                table: "BaseItems",
 0186                keyColumn: "Id",
 0187                keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
 0188                columns: new[] { "Name", "OwnerId" },
 0189                values: new object[] { "This is a placeholder item for UserData that has been detacted from its original
 0190        }
 191    }
 192}

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20260113203012_ChangeOwnerIdToGuid.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("20260113203012_ChangeOwnerIdToGuid")]
 15    partial class ChangeOwnerIdToGuid
 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?>("BaseItemEntityId")
 27166                        .HasColumnType("TEXT");
 27167
 27168                    b.Property<Guid?>("ChannelId")
 27169                        .HasColumnType("TEXT");
 27170
 27171                    b.Property<string>("CleanName")
 27172                        .HasColumnType("TEXT");
 27173
 27174                    b.Property<float?>("CommunityRating")
 27175                        .HasColumnType("REAL");
 27176
 27177                    b.Property<float?>("CriticRating")
 27178                        .HasColumnType("REAL");
 27179
 27180                    b.Property<string>("CustomRating")
 27181                        .HasColumnType("TEXT");
 27182
 27183                    b.Property<string>("Data")
 27184                        .HasColumnType("TEXT");
 27185
 27186                    b.Property<DateTime?>("DateCreated")
 27187                        .HasColumnType("TEXT");
 27188
 27189                    b.Property<DateTime?>("DateLastMediaAdded")
 27190                        .HasColumnType("TEXT");
 27191
 27192                    b.Property<DateTime?>("DateLastRefreshed")
 27193                        .HasColumnType("TEXT");
 27194
 27195                    b.Property<DateTime?>("DateLastSaved")
 27196                        .HasColumnType("TEXT");
 27197
 27198                    b.Property<DateTime?>("DateModified")
 27199                        .HasColumnType("TEXT");
 27200
 27201                    b.Property<DateTime?>("EndDate")
 27202                        .HasColumnType("TEXT");
 27203
 27204                    b.Property<string>("EpisodeTitle")
 27205                        .HasColumnType("TEXT");
 27206
 27207                    b.Property<string>("ExternalId")
 27208                        .HasColumnType("TEXT");
 27209
 27210                    b.Property<string>("ExternalSeriesId")
 27211                        .HasColumnType("TEXT");
 27212
 27213                    b.Property<string>("ExternalServiceId")
 27214                        .HasColumnType("TEXT");
 27215
 27216                    b.Property<string>("ExtraIds")
 27217                        .HasColumnType("TEXT");
 27218
 27219                    b.Property<int?>("ExtraType")
 27220                        .HasColumnType("INTEGER");
 27221
 27222                    b.Property<string>("ForcedSortName")
 27223                        .HasColumnType("TEXT");
 27224
 27225                    b.Property<string>("Genres")
 27226                        .HasColumnType("TEXT");
 27227
 27228                    b.Property<int?>("Height")
 27229                        .HasColumnType("INTEGER");
 27230
 27231                    b.Property<int?>("IndexNumber")
 27232                        .HasColumnType("INTEGER");
 27233
 27234                    b.Property<int?>("InheritedParentalRatingSubValue")
 27235                        .HasColumnType("INTEGER");
 27236
 27237                    b.Property<int?>("InheritedParentalRatingValue")
 27238                        .HasColumnType("INTEGER");
 27239
 27240                    b.Property<bool>("IsFolder")
 27241                        .HasColumnType("INTEGER");
 27242
 27243                    b.Property<bool>("IsInMixedFolder")
 27244                        .HasColumnType("INTEGER");
 27245
 27246                    b.Property<bool>("IsLocked")
 27247                        .HasColumnType("INTEGER");
 27248
 27249                    b.Property<bool>("IsMovie")
 27250                        .HasColumnType("INTEGER");
 27251
 27252                    b.Property<bool>("IsRepeat")
 27253                        .HasColumnType("INTEGER");
 27254
 27255                    b.Property<bool>("IsSeries")
 27256                        .HasColumnType("INTEGER");
 27257
 27258                    b.Property<bool>("IsVirtualItem")
 27259                        .HasColumnType("INTEGER");
 27260
 27261                    b.Property<float?>("LUFS")
 27262                        .HasColumnType("REAL");
 27263
 27264                    b.Property<string>("MediaType")
 27265                        .HasColumnType("TEXT");
 27266
 27267                    b.Property<string>("Name")
 27268                        .HasColumnType("TEXT");
 27269
 27270                    b.Property<float?>("NormalizationGain")
 27271                        .HasColumnType("REAL");
 27272
 27273                    b.Property<string>("OfficialRating")
 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("BaseItemEntityId");
 27373
 27374                    b.HasIndex("ExtraType");
 27375
 27376                    b.HasIndex("OwnerId");
 27377
 27378                    b.HasIndex("ParentId");
 27379
 27380                    b.HasIndex("Path");
 27381
 27382                    b.HasIndex("PresentationUniqueKey");
 27383
 27384                    b.HasIndex("ExtraType", "OwnerId");
 27385
 27386                    b.HasIndex("TopParentId", "Id");
 27387
 27388                    b.HasIndex("Type", "TopParentId", "Id");
 27389
 27390                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 27391
 27392                    b.HasIndex("Type", "TopParentId", "StartDate");
 27393
 27394                    b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem");
 27395
 27396                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 27397
 27398                    b.HasIndex("TopParentId", "IsFolder", "IsVirtualItem", "DateCreated");
 27399
 27400                    b.HasIndex("TopParentId", "MediaType", "IsVirtualItem", "DateCreated");
 27401
 27402                    b.HasIndex("TopParentId", "Type", "IsVirtualItem", "DateCreated");
 27403
 27404                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 27405
 27406                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 27407
 27408                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27409
 27410                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27411
 27412                    b.ToTable("BaseItems");
 27413
 27414                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27415
 27416                    b.HasData(
 27417                        new
 27418                        {
 27419                            Id = new Guid("00000000-0000-0000-0000-000000000001"),
 27420                            IsFolder = false,
 27421                            IsInMixedFolder = false,
 27422                            IsLocked = false,
 27423                            IsMovie = false,
 27424                            IsRepeat = false,
 27425                            IsSeries = false,
 27426                            IsVirtualItem = false,
 27427                            Name = "This is a placeholder item for UserData that has been detached from its original ite
 27428                            Type = "PLACEHOLDER"
 27429                        });
 27430                });
 431
 27432            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 27433                {
 27434                    b.Property<Guid>("Id")
 27435                        .ValueGeneratedOnAdd()
 27436                        .HasColumnType("TEXT");
 27437
 27438                    b.Property<byte[]>("Blurhash")
 27439                        .HasColumnType("BLOB");
 27440
 27441                    b.Property<DateTime?>("DateModified")
 27442                        .HasColumnType("TEXT");
 27443
 27444                    b.Property<int>("Height")
 27445                        .HasColumnType("INTEGER");
 27446
 27447                    b.Property<int>("ImageType")
 27448                        .HasColumnType("INTEGER");
 27449
 27450                    b.Property<Guid>("ItemId")
 27451                        .HasColumnType("TEXT");
 27452
 27453                    b.Property<string>("Path")
 27454                        .IsRequired()
 27455                        .HasColumnType("TEXT");
 27456
 27457                    b.Property<int>("Width")
 27458                        .HasColumnType("INTEGER");
 27459
 27460                    b.HasKey("Id");
 27461
 27462                    b.HasIndex("ItemId");
 27463
 27464                    b.ToTable("BaseItemImageInfos");
 27465
 27466                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27467                });
 468
 27469            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 27470                {
 27471                    b.Property<int>("Id")
 27472                        .HasColumnType("INTEGER");
 27473
 27474                    b.Property<Guid>("ItemId")
 27475                        .HasColumnType("TEXT");
 27476
 27477                    b.HasKey("Id", "ItemId");
 27478
 27479                    b.HasIndex("ItemId");
 27480
 27481                    b.ToTable("BaseItemMetadataFields");
 27482
 27483                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27484                });
 485
 27486            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 27487                {
 27488                    b.Property<Guid>("ItemId")
 27489                        .HasColumnType("TEXT");
 27490
 27491                    b.Property<string>("ProviderId")
 27492                        .HasColumnType("TEXT");
 27493
 27494                    b.Property<string>("ProviderValue")
 27495                        .IsRequired()
 27496                        .HasColumnType("TEXT");
 27497
 27498                    b.HasKey("ItemId", "ProviderId");
 27499
 27500                    b.HasIndex("ProviderId", "ProviderValue", "ItemId");
 27501
 27502                    b.ToTable("BaseItemProviders");
 27503
 27504                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27505                });
 506
 27507            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 27508                {
 27509                    b.Property<int>("Id")
 27510                        .HasColumnType("INTEGER");
 27511
 27512                    b.Property<Guid>("ItemId")
 27513                        .HasColumnType("TEXT");
 27514
 27515                    b.HasKey("Id", "ItemId");
 27516
 27517                    b.HasIndex("ItemId");
 27518
 27519                    b.ToTable("BaseItemTrailerTypes");
 27520
 27521                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27522                });
 523
 27524            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 27525                {
 27526                    b.Property<Guid>("ItemId")
 27527                        .HasColumnType("TEXT");
 27528
 27529                    b.Property<int>("ChapterIndex")
 27530                        .HasColumnType("INTEGER");
 27531
 27532                    b.Property<DateTime?>("ImageDateModified")
 27533                        .HasColumnType("TEXT");
 27534
 27535                    b.Property<string>("ImagePath")
 27536                        .HasColumnType("TEXT");
 27537
 27538                    b.Property<string>("Name")
 27539                        .HasColumnType("TEXT");
 27540
 27541                    b.Property<long>("StartPositionTicks")
 27542                        .HasColumnType("INTEGER");
 27543
 27544                    b.HasKey("ItemId", "ChapterIndex");
 27545
 27546                    b.ToTable("Chapters");
 27547
 27548                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27549                });
 550
 27551            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.CustomItemDisplayPreferences", b =>
 27552                {
 27553                    b.Property<int>("Id")
 27554                        .ValueGeneratedOnAdd()
 27555                        .HasColumnType("INTEGER");
 27556
 27557                    b.Property<string>("Client")
 27558                        .IsRequired()
 27559                        .HasMaxLength(32)
 27560                        .HasColumnType("TEXT");
 27561
 27562                    b.Property<Guid>("ItemId")
 27563                        .HasColumnType("TEXT");
 27564
 27565                    b.Property<string>("Key")
 27566                        .IsRequired()
 27567                        .HasColumnType("TEXT");
 27568
 27569                    b.Property<Guid>("UserId")
 27570                        .HasColumnType("TEXT");
 27571
 27572                    b.Property<string>("Value")
 27573                        .HasColumnType("TEXT");
 27574
 27575                    b.HasKey("Id");
 27576
 27577                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 27578                        .IsUnique();
 27579
 27580                    b.ToTable("CustomItemDisplayPreferences");
 27581
 27582                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27583                });
 584
 27585            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 27586                {
 27587                    b.Property<int>("Id")
 27588                        .ValueGeneratedOnAdd()
 27589                        .HasColumnType("INTEGER");
 27590
 27591                    b.Property<int>("ChromecastVersion")
 27592                        .HasColumnType("INTEGER");
 27593
 27594                    b.Property<string>("Client")
 27595                        .IsRequired()
 27596                        .HasMaxLength(32)
 27597                        .HasColumnType("TEXT");
 27598
 27599                    b.Property<string>("DashboardTheme")
 27600                        .HasMaxLength(32)
 27601                        .HasColumnType("TEXT");
 27602
 27603                    b.Property<bool>("EnableNextVideoInfoOverlay")
 27604                        .HasColumnType("INTEGER");
 27605
 27606                    b.Property<int?>("IndexBy")
 27607                        .HasColumnType("INTEGER");
 27608
 27609                    b.Property<Guid>("ItemId")
 27610                        .HasColumnType("TEXT");
 27611
 27612                    b.Property<int>("ScrollDirection")
 27613                        .HasColumnType("INTEGER");
 27614
 27615                    b.Property<bool>("ShowBackdrop")
 27616                        .HasColumnType("INTEGER");
 27617
 27618                    b.Property<bool>("ShowSidebar")
 27619                        .HasColumnType("INTEGER");
 27620
 27621                    b.Property<int>("SkipBackwardLength")
 27622                        .HasColumnType("INTEGER");
 27623
 27624                    b.Property<int>("SkipForwardLength")
 27625                        .HasColumnType("INTEGER");
 27626
 27627                    b.Property<string>("TvHome")
 27628                        .HasMaxLength(32)
 27629                        .HasColumnType("TEXT");
 27630
 27631                    b.Property<Guid>("UserId")
 27632                        .HasColumnType("TEXT");
 27633
 27634                    b.HasKey("Id");
 27635
 27636                    b.HasIndex("UserId", "ItemId", "Client")
 27637                        .IsUnique();
 27638
 27639                    b.ToTable("DisplayPreferences");
 27640
 27641                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27642                });
 643
 27644            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 27645                {
 27646                    b.Property<int>("Id")
 27647                        .ValueGeneratedOnAdd()
 27648                        .HasColumnType("INTEGER");
 27649
 27650                    b.Property<int>("DisplayPreferencesId")
 27651                        .HasColumnType("INTEGER");
 27652
 27653                    b.Property<int>("Order")
 27654                        .HasColumnType("INTEGER");
 27655
 27656                    b.Property<int>("Type")
 27657                        .HasColumnType("INTEGER");
 27658
 27659                    b.HasKey("Id");
 27660
 27661                    b.HasIndex("DisplayPreferencesId");
 27662
 27663                    b.ToTable("HomeSection");
 27664
 27665                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27666                });
 667
 27668            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 27669                {
 27670                    b.Property<int>("Id")
 27671                        .ValueGeneratedOnAdd()
 27672                        .HasColumnType("INTEGER");
 27673
 27674                    b.Property<DateTime>("LastModified")
 27675                        .HasColumnType("TEXT");
 27676
 27677                    b.Property<string>("Path")
 27678                        .IsRequired()
 27679                        .HasMaxLength(512)
 27680                        .HasColumnType("TEXT");
 27681
 27682                    b.Property<Guid?>("UserId")
 27683                        .HasColumnType("TEXT");
 27684
 27685                    b.HasKey("Id");
 27686
 27687                    b.HasIndex("UserId")
 27688                        .IsUnique();
 27689
 27690                    b.ToTable("ImageInfos");
 27691
 27692                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27693                });
 694
 27695            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 27696                {
 27697                    b.Property<int>("Id")
 27698                        .ValueGeneratedOnAdd()
 27699                        .HasColumnType("INTEGER");
 27700
 27701                    b.Property<string>("Client")
 27702                        .IsRequired()
 27703                        .HasMaxLength(32)
 27704                        .HasColumnType("TEXT");
 27705
 27706                    b.Property<int?>("IndexBy")
 27707                        .HasColumnType("INTEGER");
 27708
 27709                    b.Property<Guid>("ItemId")
 27710                        .HasColumnType("TEXT");
 27711
 27712                    b.Property<bool>("RememberIndexing")
 27713                        .HasColumnType("INTEGER");
 27714
 27715                    b.Property<bool>("RememberSorting")
 27716                        .HasColumnType("INTEGER");
 27717
 27718                    b.Property<string>("SortBy")
 27719                        .IsRequired()
 27720                        .HasMaxLength(64)
 27721                        .HasColumnType("TEXT");
 27722
 27723                    b.Property<int>("SortOrder")
 27724                        .HasColumnType("INTEGER");
 27725
 27726                    b.Property<Guid>("UserId")
 27727                        .HasColumnType("TEXT");
 27728
 27729                    b.Property<int>("ViewType")
 27730                        .HasColumnType("INTEGER");
 27731
 27732                    b.HasKey("Id");
 27733
 27734                    b.HasIndex("UserId");
 27735
 27736                    b.ToTable("ItemDisplayPreferences");
 27737
 27738                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27739                });
 740
 27741            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 27742                {
 27743                    b.Property<Guid>("ItemValueId")
 27744                        .ValueGeneratedOnAdd()
 27745                        .HasColumnType("TEXT");
 27746
 27747                    b.Property<string>("CleanValue")
 27748                        .IsRequired()
 27749                        .HasColumnType("TEXT");
 27750
 27751                    b.Property<int>("Type")
 27752                        .HasColumnType("INTEGER");
 27753
 27754                    b.Property<string>("Value")
 27755                        .IsRequired()
 27756                        .HasColumnType("TEXT");
 27757
 27758                    b.HasKey("ItemValueId");
 27759
 27760                    b.HasIndex("Type", "CleanValue");
 27761
 27762                    b.HasIndex("Type", "Value")
 27763                        .IsUnique();
 27764
 27765                    b.ToTable("ItemValues");
 27766
 27767                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27768                });
 769
 27770            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 27771                {
 27772                    b.Property<Guid>("ItemValueId")
 27773                        .HasColumnType("TEXT");
 27774
 27775                    b.Property<Guid>("ItemId")
 27776                        .HasColumnType("TEXT");
 27777
 27778                    b.HasKey("ItemValueId", "ItemId");
 27779
 27780                    b.HasIndex("ItemId");
 27781
 27782                    b.ToTable("ItemValuesMap");
 27783
 27784                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27785                });
 786
 27787            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 27788                {
 27789                    b.Property<Guid>("ItemId")
 27790                        .HasColumnType("TEXT");
 27791
 27792                    b.PrimitiveCollection<string>("KeyframeTicks")
 27793                        .HasColumnType("TEXT");
 27794
 27795                    b.Property<long>("TotalDuration")
 27796                        .HasColumnType("INTEGER");
 27797
 27798                    b.HasKey("ItemId");
 27799
 27800                    b.ToTable("KeyframeData");
 27801
 27802                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27803                });
 804
 27805            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 27806                {
 27807                    b.Property<Guid>("ParentId")
 27808                        .HasColumnType("TEXT");
 27809
 27810                    b.Property<Guid>("ChildId")
 27811                        .HasColumnType("TEXT");
 27812
 27813                    b.Property<int>("ChildType")
 27814                        .HasColumnType("INTEGER");
 27815
 27816                    b.Property<int?>("SortOrder")
 27817                        .HasColumnType("INTEGER");
 27818
 27819                    b.HasKey("ParentId", "ChildId");
 27820
 27821                    b.HasIndex("ChildId");
 27822
 27823                    b.HasIndex("ParentId");
 27824
 27825                    b.HasIndex("ChildId", "ChildType");
 27826
 27827                    b.HasIndex("ParentId", "ChildType");
 27828
 27829                    b.HasIndex("ParentId", "SortOrder");
 27830
 27831                    b.ToTable("LinkedChildren", (string)null);
 27832
 27833                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27834                });
 835
 27836            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaSegment", b =>
 27837                {
 27838                    b.Property<Guid>("Id")
 27839                        .ValueGeneratedOnAdd()
 27840                        .HasColumnType("TEXT");
 27841
 27842                    b.Property<long>("EndTicks")
 27843                        .HasColumnType("INTEGER");
 27844
 27845                    b.Property<Guid>("ItemId")
 27846                        .HasColumnType("TEXT");
 27847
 27848                    b.Property<string>("SegmentProviderId")
 27849                        .IsRequired()
 27850                        .HasColumnType("TEXT");
 27851
 27852                    b.Property<long>("StartTicks")
 27853                        .HasColumnType("INTEGER");
 27854
 27855                    b.Property<int>("Type")
 27856                        .HasColumnType("INTEGER");
 27857
 27858                    b.HasKey("Id");
 27859
 27860                    b.ToTable("MediaSegments");
 27861
 27862                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 27863                });
 864
 27865            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 27866                {
 27867                    b.Property<Guid>("ItemId")
 27868                        .HasColumnType("TEXT");
 27869
 27870                    b.Property<int>("StreamIndex")
 27871                        .HasColumnType("INTEGER");
 27872
 27873                    b.Property<string>("AspectRatio")
 27874                        .HasColumnType("TEXT");
 27875
 27876                    b.Property<float?>("AverageFrameRate")
 27877                        .HasColumnType("REAL");
 27878
 27879                    b.Property<int?>("BitDepth")
 27880                        .HasColumnType("INTEGER");
 27881
 27882                    b.Property<int?>("BitRate")
 27883                        .HasColumnType("INTEGER");
 27884
 27885                    b.Property<int?>("BlPresentFlag")
 27886                        .HasColumnType("INTEGER");
 27887
 27888                    b.Property<string>("ChannelLayout")
 27889                        .HasColumnType("TEXT");
 27890
 27891                    b.Property<int?>("Channels")
 27892                        .HasColumnType("INTEGER");
 27893
 27894                    b.Property<string>("Codec")
 27895                        .HasColumnType("TEXT");
 27896
 27897                    b.Property<string>("CodecTag")
 27898                        .HasColumnType("TEXT");
 27899
 27900                    b.Property<string>("CodecTimeBase")
 27901                        .HasColumnType("TEXT");
 27902
 27903                    b.Property<string>("ColorPrimaries")
 27904                        .HasColumnType("TEXT");
 27905
 27906                    b.Property<string>("ColorSpace")
 27907                        .HasColumnType("TEXT");
 27908
 27909                    b.Property<string>("ColorTransfer")
 27910                        .HasColumnType("TEXT");
 27911
 27912                    b.Property<string>("Comment")
 27913                        .HasColumnType("TEXT");
 27914
 27915                    b.Property<int?>("DvBlSignalCompatibilityId")
 27916                        .HasColumnType("INTEGER");
 27917
 27918                    b.Property<int?>("DvLevel")
 27919                        .HasColumnType("INTEGER");
 27920
 27921                    b.Property<int?>("DvProfile")
 27922                        .HasColumnType("INTEGER");
 27923
 27924                    b.Property<int?>("DvVersionMajor")
 27925                        .HasColumnType("INTEGER");
 27926
 27927                    b.Property<int?>("DvVersionMinor")
 27928                        .HasColumnType("INTEGER");
 27929
 27930                    b.Property<int?>("ElPresentFlag")
 27931                        .HasColumnType("INTEGER");
 27932
 27933                    b.Property<bool?>("Hdr10PlusPresentFlag")
 27934                        .HasColumnType("INTEGER");
 27935
 27936                    b.Property<int?>("Height")
 27937                        .HasColumnType("INTEGER");
 27938
 27939                    b.Property<bool?>("IsAnamorphic")
 27940                        .HasColumnType("INTEGER");
 27941
 27942                    b.Property<bool?>("IsAvc")
 27943                        .HasColumnType("INTEGER");
 27944
 27945                    b.Property<bool>("IsDefault")
 27946                        .HasColumnType("INTEGER");
 27947
 27948                    b.Property<bool>("IsExternal")
 27949                        .HasColumnType("INTEGER");
 27950
 27951                    b.Property<bool>("IsForced")
 27952                        .HasColumnType("INTEGER");
 27953
 27954                    b.Property<bool?>("IsHearingImpaired")
 27955                        .HasColumnType("INTEGER");
 27956
 27957                    b.Property<bool?>("IsInterlaced")
 27958                        .HasColumnType("INTEGER");
 27959
 27960                    b.Property<string>("KeyFrames")
 27961                        .HasColumnType("TEXT");
 27962
 27963                    b.Property<string>("Language")
 27964                        .HasColumnType("TEXT");
 27965
 27966                    b.Property<float?>("Level")
 27967                        .HasColumnType("REAL");
 27968
 27969                    b.Property<string>("NalLengthSize")
 27970                        .HasColumnType("TEXT");
 27971
 27972                    b.Property<string>("Path")
 27973                        .HasColumnType("TEXT");
 27974
 27975                    b.Property<string>("PixelFormat")
 27976                        .HasColumnType("TEXT");
 27977
 27978                    b.Property<string>("Profile")
 27979                        .HasColumnType("TEXT");
 27980
 27981                    b.Property<float?>("RealFrameRate")
 27982                        .HasColumnType("REAL");
 27983
 27984                    b.Property<int?>("RefFrames")
 27985                        .HasColumnType("INTEGER");
 27986
 27987                    b.Property<int?>("Rotation")
 27988                        .HasColumnType("INTEGER");
 27989
 27990                    b.Property<int?>("RpuPresentFlag")
 27991                        .HasColumnType("INTEGER");
 27992
 27993                    b.Property<int?>("SampleRate")
 27994                        .HasColumnType("INTEGER");
 27995
 27996                    b.Property<int>("StreamType")
 27997                        .HasColumnType("INTEGER");
 27998
 27999                    b.Property<string>("TimeBase")
 271000                        .HasColumnType("TEXT");
 271001
 271002                    b.Property<string>("Title")
 271003                        .HasColumnType("TEXT");
 271004
 271005                    b.Property<int?>("Width")
 271006                        .HasColumnType("INTEGER");
 271007
 271008                    b.HasKey("ItemId", "StreamIndex");
 271009
 271010                    b.HasIndex("StreamIndex");
 271011
 271012                    b.HasIndex("StreamType");
 271013
 271014                    b.HasIndex("StreamIndex", "StreamType");
 271015
 271016                    b.HasIndex("StreamIndex", "StreamType", "Language");
 271017
 271018                    b.ToTable("MediaStreamInfos");
 271019
 271020                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271021                });
 1022
 271023            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 271024                {
 271025                    b.Property<Guid>("Id")
 271026                        .ValueGeneratedOnAdd()
 271027                        .HasColumnType("TEXT");
 271028
 271029                    b.Property<string>("Name")
 271030                        .IsRequired()
 271031                        .HasColumnType("TEXT");
 271032
 271033                    b.Property<string>("PersonType")
 271034                        .HasColumnType("TEXT");
 271035
 271036                    b.HasKey("Id");
 271037
 271038                    b.HasIndex("Name");
 271039
 271040                    b.ToTable("Peoples");
 271041
 271042                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271043                });
 1044
 271045            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 271046                {
 271047                    b.Property<Guid>("ItemId")
 271048                        .HasColumnType("TEXT");
 271049
 271050                    b.Property<Guid>("PeopleId")
 271051                        .HasColumnType("TEXT");
 271052
 271053                    b.Property<string>("Role")
 271054                        .HasColumnType("TEXT");
 271055
 271056                    b.Property<int?>("ListOrder")
 271057                        .HasColumnType("INTEGER");
 271058
 271059                    b.Property<int?>("SortOrder")
 271060                        .HasColumnType("INTEGER");
 271061
 271062                    b.HasKey("ItemId", "PeopleId", "Role");
 271063
 271064                    b.HasIndex("PeopleId");
 271065
 271066                    b.HasIndex("ItemId", "ListOrder");
 271067
 271068                    b.HasIndex("ItemId", "SortOrder");
 271069
 271070                    b.ToTable("PeopleBaseItemMap");
 271071
 271072                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271073                });
 1074
 271075            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 271076                {
 271077                    b.Property<int>("Id")
 271078                        .ValueGeneratedOnAdd()
 271079                        .HasColumnType("INTEGER");
 271080
 271081                    b.Property<int>("Kind")
 271082                        .HasColumnType("INTEGER");
 271083
 271084                    b.Property<Guid?>("Permission_Permissions_Guid")
 271085                        .HasColumnType("TEXT");
 271086
 271087                    b.Property<uint>("RowVersion")
 271088                        .IsConcurrencyToken()
 271089                        .HasColumnType("INTEGER");
 271090
 271091                    b.Property<Guid?>("UserId")
 271092                        .HasColumnType("TEXT");
 271093
 271094                    b.Property<bool>("Value")
 271095                        .HasColumnType("INTEGER");
 271096
 271097                    b.HasKey("Id");
 271098
 271099                    b.HasIndex("UserId", "Kind")
 271100                        .IsUnique()
 271101                        .HasFilter("[UserId] IS NOT NULL");
 271102
 271103                    b.ToTable("Permissions");
 271104
 271105                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271106                });
 1107
 271108            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 271109                {
 271110                    b.Property<int>("Id")
 271111                        .ValueGeneratedOnAdd()
 271112                        .HasColumnType("INTEGER");
 271113
 271114                    b.Property<int>("Kind")
 271115                        .HasColumnType("INTEGER");
 271116
 271117                    b.Property<Guid?>("Preference_Preferences_Guid")
 271118                        .HasColumnType("TEXT");
 271119
 271120                    b.Property<uint>("RowVersion")
 271121                        .IsConcurrencyToken()
 271122                        .HasColumnType("INTEGER");
 271123
 271124                    b.Property<Guid?>("UserId")
 271125                        .HasColumnType("TEXT");
 271126
 271127                    b.Property<string>("Value")
 271128                        .IsRequired()
 271129                        .HasMaxLength(65535)
 271130                        .HasColumnType("TEXT");
 271131
 271132                    b.HasKey("Id");
 271133
 271134                    b.HasIndex("UserId", "Kind")
 271135                        .IsUnique()
 271136                        .HasFilter("[UserId] IS NOT NULL");
 271137
 271138                    b.ToTable("Preferences");
 271139
 271140                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271141                });
 1142
 271143            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.ApiKey", b =>
 271144                {
 271145                    b.Property<int>("Id")
 271146                        .ValueGeneratedOnAdd()
 271147                        .HasColumnType("INTEGER");
 271148
 271149                    b.Property<string>("AccessToken")
 271150                        .IsRequired()
 271151                        .HasColumnType("TEXT");
 271152
 271153                    b.Property<DateTime>("DateCreated")
 271154                        .HasColumnType("TEXT");
 271155
 271156                    b.Property<DateTime>("DateLastActivity")
 271157                        .HasColumnType("TEXT");
 271158
 271159                    b.Property<string>("Name")
 271160                        .IsRequired()
 271161                        .HasMaxLength(64)
 271162                        .HasColumnType("TEXT");
 271163
 271164                    b.HasKey("Id");
 271165
 271166                    b.HasIndex("AccessToken")
 271167                        .IsUnique();
 271168
 271169                    b.ToTable("ApiKeys");
 271170
 271171                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271172                });
 1173
 271174            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 271175                {
 271176                    b.Property<int>("Id")
 271177                        .ValueGeneratedOnAdd()
 271178                        .HasColumnType("INTEGER");
 271179
 271180                    b.Property<string>("AccessToken")
 271181                        .IsRequired()
 271182                        .HasColumnType("TEXT");
 271183
 271184                    b.Property<string>("AppName")
 271185                        .IsRequired()
 271186                        .HasMaxLength(64)
 271187                        .HasColumnType("TEXT");
 271188
 271189                    b.Property<string>("AppVersion")
 271190                        .IsRequired()
 271191                        .HasMaxLength(32)
 271192                        .HasColumnType("TEXT");
 271193
 271194                    b.Property<DateTime>("DateCreated")
 271195                        .HasColumnType("TEXT");
 271196
 271197                    b.Property<DateTime>("DateLastActivity")
 271198                        .HasColumnType("TEXT");
 271199
 271200                    b.Property<DateTime>("DateModified")
 271201                        .HasColumnType("TEXT");
 271202
 271203                    b.Property<string>("DeviceId")
 271204                        .IsRequired()
 271205                        .HasMaxLength(256)
 271206                        .HasColumnType("TEXT");
 271207
 271208                    b.Property<string>("DeviceName")
 271209                        .IsRequired()
 271210                        .HasMaxLength(64)
 271211                        .HasColumnType("TEXT");
 271212
 271213                    b.Property<bool>("IsActive")
 271214                        .HasColumnType("INTEGER");
 271215
 271216                    b.Property<Guid>("UserId")
 271217                        .HasColumnType("TEXT");
 271218
 271219                    b.HasKey("Id");
 271220
 271221                    b.HasIndex("DeviceId");
 271222
 271223                    b.HasIndex("AccessToken", "DateLastActivity");
 271224
 271225                    b.HasIndex("DeviceId", "DateLastActivity");
 271226
 271227                    b.HasIndex("UserId", "DeviceId");
 271228
 271229                    b.ToTable("Devices");
 271230
 271231                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271232                });
 1233
 271234            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.DeviceOptions", b =>
 271235                {
 271236                    b.Property<int>("Id")
 271237                        .ValueGeneratedOnAdd()
 271238                        .HasColumnType("INTEGER");
 271239
 271240                    b.Property<string>("CustomName")
 271241                        .HasColumnType("TEXT");
 271242
 271243                    b.Property<string>("DeviceId")
 271244                        .IsRequired()
 271245                        .HasColumnType("TEXT");
 271246
 271247                    b.HasKey("Id");
 271248
 271249                    b.HasIndex("DeviceId")
 271250                        .IsUnique();
 271251
 271252                    b.ToTable("DeviceOptions");
 271253
 271254                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271255                });
 1256
 271257            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.TrickplayInfo", b =>
 271258                {
 271259                    b.Property<Guid>("ItemId")
 271260                        .HasColumnType("TEXT");
 271261
 271262                    b.Property<int>("Width")
 271263                        .HasColumnType("INTEGER");
 271264
 271265                    b.Property<int>("Bandwidth")
 271266                        .HasColumnType("INTEGER");
 271267
 271268                    b.Property<int>("Height")
 271269                        .HasColumnType("INTEGER");
 271270
 271271                    b.Property<int>("Interval")
 271272                        .HasColumnType("INTEGER");
 271273
 271274                    b.Property<int>("ThumbnailCount")
 271275                        .HasColumnType("INTEGER");
 271276
 271277                    b.Property<int>("TileHeight")
 271278                        .HasColumnType("INTEGER");
 271279
 271280                    b.Property<int>("TileWidth")
 271281                        .HasColumnType("INTEGER");
 271282
 271283                    b.HasKey("ItemId", "Width");
 271284
 271285                    b.ToTable("TrickplayInfos");
 271286
 271287                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271288                });
 1289
 271290            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 271291                {
 271292                    b.Property<Guid>("Id")
 271293                        .ValueGeneratedOnAdd()
 271294                        .HasColumnType("TEXT");
 271295
 271296                    b.Property<string>("AudioLanguagePreference")
 271297                        .HasMaxLength(255)
 271298                        .HasColumnType("TEXT");
 271299
 271300                    b.Property<string>("AuthenticationProviderId")
 271301                        .IsRequired()
 271302                        .HasMaxLength(255)
 271303                        .HasColumnType("TEXT");
 271304
 271305                    b.Property<string>("CastReceiverId")
 271306                        .HasMaxLength(32)
 271307                        .HasColumnType("TEXT");
 271308
 271309                    b.Property<bool>("DisplayCollectionsView")
 271310                        .HasColumnType("INTEGER");
 271311
 271312                    b.Property<bool>("DisplayMissingEpisodes")
 271313                        .HasColumnType("INTEGER");
 271314
 271315                    b.Property<bool>("EnableAutoLogin")
 271316                        .HasColumnType("INTEGER");
 271317
 271318                    b.Property<bool>("EnableLocalPassword")
 271319                        .HasColumnType("INTEGER");
 271320
 271321                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 271322                        .HasColumnType("INTEGER");
 271323
 271324                    b.Property<bool>("EnableUserPreferenceAccess")
 271325                        .HasColumnType("INTEGER");
 271326
 271327                    b.Property<bool>("HidePlayedInLatest")
 271328                        .HasColumnType("INTEGER");
 271329
 271330                    b.Property<long>("InternalId")
 271331                        .HasColumnType("INTEGER");
 271332
 271333                    b.Property<int>("InvalidLoginAttemptCount")
 271334                        .HasColumnType("INTEGER");
 271335
 271336                    b.Property<DateTime?>("LastActivityDate")
 271337                        .HasColumnType("TEXT");
 271338
 271339                    b.Property<DateTime?>("LastLoginDate")
 271340                        .HasColumnType("TEXT");
 271341
 271342                    b.Property<int?>("LoginAttemptsBeforeLockout")
 271343                        .HasColumnType("INTEGER");
 271344
 271345                    b.Property<int>("MaxActiveSessions")
 271346                        .HasColumnType("INTEGER");
 271347
 271348                    b.Property<int?>("MaxParentalRatingScore")
 271349                        .HasColumnType("INTEGER");
 271350
 271351                    b.Property<int?>("MaxParentalRatingSubScore")
 271352                        .HasColumnType("INTEGER");
 271353
 271354                    b.Property<bool>("MustUpdatePassword")
 271355                        .HasColumnType("INTEGER");
 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("Username")
 271400                        .IsUnique();
 271401
 271402                    b.ToTable("Users");
 271403
 271404                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271405                });
 1406
 271407            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 271408                {
 271409                    b.Property<Guid>("ItemId")
 271410                        .HasColumnType("TEXT");
 271411
 271412                    b.Property<Guid>("UserId")
 271413                        .HasColumnType("TEXT");
 271414
 271415                    b.Property<string>("CustomDataKey")
 271416                        .HasColumnType("TEXT");
 271417
 271418                    b.Property<int?>("AudioStreamIndex")
 271419                        .HasColumnType("INTEGER");
 271420
 271421                    b.Property<bool>("IsFavorite")
 271422                        .HasColumnType("INTEGER");
 271423
 271424                    b.Property<DateTime?>("LastPlayedDate")
 271425                        .HasColumnType("TEXT");
 271426
 271427                    b.Property<bool?>("Likes")
 271428                        .HasColumnType("INTEGER");
 271429
 271430                    b.Property<int>("PlayCount")
 271431                        .HasColumnType("INTEGER");
 271432
 271433                    b.Property<long>("PlaybackPositionTicks")
 271434                        .HasColumnType("INTEGER");
 271435
 271436                    b.Property<bool>("Played")
 271437                        .HasColumnType("INTEGER");
 271438
 271439                    b.Property<double?>("Rating")
 271440                        .HasColumnType("REAL");
 271441
 271442                    b.Property<DateTime?>("RetentionDate")
 271443                        .HasColumnType("TEXT");
 271444
 271445                    b.Property<int?>("SubtitleStreamIndex")
 271446                        .HasColumnType("INTEGER");
 271447
 271448                    b.HasKey("ItemId", "UserId", "CustomDataKey");
 271449
 271450                    b.HasIndex("UserId");
 271451
 271452                    b.HasIndex("ItemId", "UserId", "IsFavorite");
 271453
 271454                    b.HasIndex("ItemId", "UserId", "LastPlayedDate");
 271455
 271456                    b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
 271457
 271458                    b.HasIndex("ItemId", "UserId", "Played");
 271459
 271460                    b.ToTable("UserData");
 271461
 271462                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 271463                });
 1464
 271465            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 271466                {
 271467                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271468                        .WithMany("AccessSchedules")
 271469                        .HasForeignKey("UserId")
 271470                        .OnDelete(DeleteBehavior.Cascade)
 271471                        .IsRequired();
 271472                });
 1473
 271474            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 271475                {
 271476                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271477                        .WithMany("Parents")
 271478                        .HasForeignKey("ItemId")
 271479                        .OnDelete(DeleteBehavior.Cascade)
 271480                        .IsRequired();
 271481
 271482                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "ParentItem")
 271483                        .WithMany("Children")
 271484                        .HasForeignKey("ParentItemId")
 271485                        .OnDelete(DeleteBehavior.Cascade)
 271486                        .IsRequired();
 271487
 271488                    b.Navigation("Item");
 271489
 271490                    b.Navigation("ParentItem");
 271491                });
 1492
 271493            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 271494                {
 271495                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271496                        .WithMany()
 271497                        .HasForeignKey("ItemId")
 271498                        .OnDelete(DeleteBehavior.Cascade)
 271499                        .IsRequired();
 271500
 271501                    b.Navigation("Item");
 271502                });
 1503
 271504            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 271505                {
 271506                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", null)
 271507                        .WithMany("Extras")
 271508                        .HasForeignKey("BaseItemEntityId");
 271509
 271510                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "DirectParent")
 271511                        .WithMany("DirectChildren")
 271512                        .HasForeignKey("ParentId")
 271513                        .OnDelete(DeleteBehavior.Cascade);
 271514
 271515                    b.Navigation("DirectParent");
 271516                });
 1517
 271518            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 271519                {
 271520                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271521                        .WithMany("Images")
 271522                        .HasForeignKey("ItemId")
 271523                        .OnDelete(DeleteBehavior.Cascade)
 271524                        .IsRequired();
 271525
 271526                    b.Navigation("Item");
 271527                });
 1528
 271529            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 271530                {
 271531                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271532                        .WithMany("LockedFields")
 271533                        .HasForeignKey("ItemId")
 271534                        .OnDelete(DeleteBehavior.Cascade)
 271535                        .IsRequired();
 271536
 271537                    b.Navigation("Item");
 271538                });
 1539
 271540            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 271541                {
 271542                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271543                        .WithMany("Provider")
 271544                        .HasForeignKey("ItemId")
 271545                        .OnDelete(DeleteBehavior.Cascade)
 271546                        .IsRequired();
 271547
 271548                    b.Navigation("Item");
 271549                });
 1550
 271551            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 271552                {
 271553                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271554                        .WithMany("TrailerTypes")
 271555                        .HasForeignKey("ItemId")
 271556                        .OnDelete(DeleteBehavior.Cascade)
 271557                        .IsRequired();
 271558
 271559                    b.Navigation("Item");
 271560                });
 1561
 271562            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 271563                {
 271564                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271565                        .WithMany("Chapters")
 271566                        .HasForeignKey("ItemId")
 271567                        .OnDelete(DeleteBehavior.Cascade)
 271568                        .IsRequired();
 271569
 271570                    b.Navigation("Item");
 271571                });
 1572
 271573            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 271574                {
 271575                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271576                        .WithMany("DisplayPreferences")
 271577                        .HasForeignKey("UserId")
 271578                        .OnDelete(DeleteBehavior.Cascade)
 271579                        .IsRequired();
 271580                });
 1581
 271582            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 271583                {
 271584                    b.HasOne("Jellyfin.Database.Implementations.Entities.DisplayPreferences", null)
 271585                        .WithMany("HomeSections")
 271586                        .HasForeignKey("DisplayPreferencesId")
 271587                        .OnDelete(DeleteBehavior.Cascade)
 271588                        .IsRequired();
 271589                });
 1590
 271591            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 271592                {
 271593                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271594                        .WithOne("ProfileImage")
 271595                        .HasForeignKey("Jellyfin.Database.Implementations.Entities.ImageInfo", "UserId")
 271596                        .OnDelete(DeleteBehavior.Cascade);
 271597                });
 1598
 271599            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 271600                {
 271601                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271602                        .WithMany("ItemDisplayPreferences")
 271603                        .HasForeignKey("UserId")
 271604                        .OnDelete(DeleteBehavior.Cascade)
 271605                        .IsRequired();
 271606                });
 1607
 271608            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 271609                {
 271610                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271611                        .WithMany("ItemValues")
 271612                        .HasForeignKey("ItemId")
 271613                        .OnDelete(DeleteBehavior.Cascade)
 271614                        .IsRequired();
 271615
 271616                    b.HasOne("Jellyfin.Database.Implementations.Entities.ItemValue", "ItemValue")
 271617                        .WithMany("BaseItemsMap")
 271618                        .HasForeignKey("ItemValueId")
 271619                        .OnDelete(DeleteBehavior.Cascade)
 271620                        .IsRequired();
 271621
 271622                    b.Navigation("Item");
 271623
 271624                    b.Navigation("ItemValue");
 271625                });
 1626
 271627            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 271628                {
 271629                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271630                        .WithMany()
 271631                        .HasForeignKey("ItemId")
 271632                        .OnDelete(DeleteBehavior.Cascade)
 271633                        .IsRequired();
 271634
 271635                    b.Navigation("Item");
 271636                });
 1637
 271638            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 271639                {
 271640                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Child")
 271641                        .WithMany("LinkedChildOfEntities")
 271642                        .HasForeignKey("ChildId")
 271643                        .OnDelete(DeleteBehavior.NoAction)
 271644                        .IsRequired();
 271645
 271646                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Parent")
 271647                        .WithMany("LinkedChildEntities")
 271648                        .HasForeignKey("ParentId")
 271649                        .OnDelete(DeleteBehavior.NoAction)
 271650                        .IsRequired();
 271651
 271652                    b.Navigation("Child");
 271653
 271654                    b.Navigation("Parent");
 271655                });
 1656
 271657            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 271658                {
 271659                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271660                        .WithMany("MediaStreams")
 271661                        .HasForeignKey("ItemId")
 271662                        .OnDelete(DeleteBehavior.Cascade)
 271663                        .IsRequired();
 271664
 271665                    b.Navigation("Item");
 271666                });
 1667
 271668            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 271669                {
 271670                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271671                        .WithMany("Peoples")
 271672                        .HasForeignKey("ItemId")
 271673                        .OnDelete(DeleteBehavior.Cascade)
 271674                        .IsRequired();
 271675
 271676                    b.HasOne("Jellyfin.Database.Implementations.Entities.People", "People")
 271677                        .WithMany("BaseItems")
 271678                        .HasForeignKey("PeopleId")
 271679                        .OnDelete(DeleteBehavior.Cascade)
 271680                        .IsRequired();
 271681
 271682                    b.Navigation("Item");
 271683
 271684                    b.Navigation("People");
 271685                });
 1686
 271687            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 271688                {
 271689                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271690                        .WithMany("Permissions")
 271691                        .HasForeignKey("UserId")
 271692                        .OnDelete(DeleteBehavior.Cascade);
 271693                });
 1694
 271695            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 271696                {
 271697                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 271698                        .WithMany("Preferences")
 271699                        .HasForeignKey("UserId")
 271700                        .OnDelete(DeleteBehavior.Cascade);
 271701                });
 1702
 271703            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 271704                {
 271705                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 271706                        .WithMany()
 271707                        .HasForeignKey("UserId")
 271708                        .OnDelete(DeleteBehavior.Cascade)
 271709                        .IsRequired();
 271710
 271711                    b.Navigation("User");
 271712                });
 1713
 271714            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 271715                {
 271716                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 271717                        .WithMany("UserData")
 271718                        .HasForeignKey("ItemId")
 271719                        .OnDelete(DeleteBehavior.Cascade)
 271720                        .IsRequired();
 271721
 271722                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 271723                        .WithMany()
 271724                        .HasForeignKey("UserId")
 271725                        .OnDelete(DeleteBehavior.Cascade)
 271726                        .IsRequired();
 271727
 271728                    b.Navigation("Item");
 271729
 271730                    b.Navigation("User");
 271731                });
 1732
 271733            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 271734                {
 271735                    b.Navigation("Chapters");
 271736
 271737                    b.Navigation("Children");
 271738
 271739                    b.Navigation("DirectChildren");
 271740
 271741                    b.Navigation("Extras");
 271742
 271743                    b.Navigation("Images");
 271744
 271745                    b.Navigation("ItemValues");
 271746
 271747                    b.Navigation("LinkedChildEntities");
 271748
 271749                    b.Navigation("LinkedChildOfEntities");
 271750
 271751                    b.Navigation("LockedFields");
 271752
 271753                    b.Navigation("MediaStreams");
 271754
 271755                    b.Navigation("Parents");
 271756
 271757                    b.Navigation("Peoples");
 271758
 271759                    b.Navigation("Provider");
 271760
 271761                    b.Navigation("TrailerTypes");
 271762
 271763                    b.Navigation("UserData");
 271764                });
 1765
 271766            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 271767                {
 271768                    b.Navigation("HomeSections");
 271769                });
 1770
 271771            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 271772                {
 271773                    b.Navigation("BaseItemsMap");
 271774                });
 1775
 271776            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 271777                {
 271778                    b.Navigation("BaseItems");
 271779                });
 1780
 271781            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 271782                {
 271783                    b.Navigation("AccessSchedules");
 271784
 271785                    b.Navigation("DisplayPreferences");
 271786
 271787                    b.Navigation("ItemDisplayPreferences");
 271788
 271789                    b.Navigation("Permissions");
 271790
 271791                    b.Navigation("Preferences");
 271792
 271793                    b.Navigation("ProfileImage");
 271794                });
 1795#pragma warning restore 612, 618
 271796        }
 1797    }
 1798}