< 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/8/2026 - 12:15:13 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        {
 2214            migrationBuilder.DropForeignKey(
 2215                name: "FK_BaseItems_BaseItems_BaseItemEntityId",
 2216                table: "BaseItems");
 17
 2218            migrationBuilder.DropIndex(
 2219                name: "IX_BaseItems_BaseItemEntityId",
 2220                table: "BaseItems");
 21
 2222            migrationBuilder.DropColumn(
 2223                name: "BaseItemEntityId",
 2224                table: "BaseItems");
 25
 2226            migrationBuilder.Sql(
 2227                """
 2228                UPDATE BaseItems
 2229                SET OwnerId = '00000000-0000-0000-0000-000000000001'
 2230                WHERE OwnerId IS NOT NULL
 2231                  AND OwnerId NOT IN (SELECT Id FROM BaseItems);
 2232                """);
 33
 2234            migrationBuilder.AddForeignKey(
 2235                name: "FK_BaseItems_BaseItems_OwnerId",
 2236                table: "BaseItems",
 2237                column: "OwnerId",
 2238                principalTable: "BaseItems",
 2239                principalColumn: "Id");
 40
 2241            migrationBuilder.AddColumn<bool>(
 2242                name: "IsOriginal",
 2243                table: "MediaStreamInfos",
 2244                type: "INTEGER",
 2245                nullable: false,
 2246                defaultValue: false);
 47
 2248            migrationBuilder.AddColumn<string>(
 2249                name: "OriginalLanguage",
 2250                table: "BaseItems",
 2251                type: "TEXT",
 2252                nullable: true);
 53
 2254            migrationBuilder.UpdateData(
 2255                table: "BaseItems",
 2256                keyColumn: "Id",
 2257                keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
 2258                column: "OriginalLanguage",
 2259                value: null);
 2260        }
 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
 2221            modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
 22
 2223            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 2224                {
 2225                    b.Property<int>("Id")
 2226                        .ValueGeneratedOnAdd()
 2227                        .HasColumnType("INTEGER");
 2228
 2229                    b.Property<int>("DayOfWeek")
 2230                        .HasColumnType("INTEGER");
 2231
 2232                    b.Property<double>("EndHour")
 2233                        .HasColumnType("REAL");
 2234
 2235                    b.Property<double>("StartHour")
 2236                        .HasColumnType("REAL");
 2237
 2238                    b.Property<Guid>("UserId")
 2239                        .HasColumnType("TEXT");
 2240
 2241                    b.HasKey("Id");
 2242
 2243                    b.HasIndex("UserId");
 2244
 2245                    b.ToTable("AccessSchedules");
 2246
 2247                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 2248                });
 49
 2250            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ActivityLog", b =>
 2251                {
 2252                    b.Property<int>("Id")
 2253                        .ValueGeneratedOnAdd()
 2254                        .HasColumnType("INTEGER");
 2255
 2256                    b.Property<DateTime>("DateCreated")
 2257                        .HasColumnType("TEXT");
 2258
 2259                    b.Property<string>("ItemId")
 2260                        .HasMaxLength(256)
 2261                        .HasColumnType("TEXT");
 2262
 2263                    b.Property<int>("LogSeverity")
 2264                        .HasColumnType("INTEGER");
 2265
 2266                    b.Property<string>("Name")
 2267                        .IsRequired()
 2268                        .HasMaxLength(512)
 2269                        .HasColumnType("TEXT");
 2270
 2271                    b.Property<string>("Overview")
 2272                        .HasMaxLength(512)
 2273                        .HasColumnType("TEXT");
 2274
 2275                    b.Property<uint>("RowVersion")
 2276                        .IsConcurrencyToken()
 2277                        .HasColumnType("INTEGER");
 2278
 2279                    b.Property<string>("ShortOverview")
 2280                        .HasMaxLength(512)
 2281                        .HasColumnType("TEXT");
 2282
 2283                    b.Property<string>("Type")
 2284                        .IsRequired()
 2285                        .HasMaxLength(256)
 2286                        .HasColumnType("TEXT");
 2287
 2288                    b.Property<Guid>("UserId")
 2289                        .HasColumnType("TEXT");
 2290
 2291                    b.HasKey("Id");
 2292
 2293                    b.HasIndex("DateCreated");
 2294
 2295                    b.ToTable("ActivityLogs");
 2296
 2297                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 2298                });
 99
 22100            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 22101                {
 22102                    b.Property<Guid>("ItemId")
 22103                        .HasColumnType("TEXT");
 22104
 22105                    b.Property<Guid>("ParentItemId")
 22106                        .HasColumnType("TEXT");
 22107
 22108                    b.HasKey("ItemId", "ParentItemId");
 22109
 22110                    b.HasIndex("ParentItemId");
 22111
 22112                    b.ToTable("AncestorIds");
 22113
 22114                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22115                });
 116
 22117            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 22118                {
 22119                    b.Property<Guid>("ItemId")
 22120                        .HasColumnType("TEXT");
 22121
 22122                    b.Property<int>("Index")
 22123                        .HasColumnType("INTEGER");
 22124
 22125                    b.Property<string>("Codec")
 22126                        .HasColumnType("TEXT");
 22127
 22128                    b.Property<string>("CodecTag")
 22129                        .HasColumnType("TEXT");
 22130
 22131                    b.Property<string>("Comment")
 22132                        .HasColumnType("TEXT");
 22133
 22134                    b.Property<string>("Filename")
 22135                        .HasColumnType("TEXT");
 22136
 22137                    b.Property<string>("MimeType")
 22138                        .HasColumnType("TEXT");
 22139
 22140                    b.HasKey("ItemId", "Index");
 22141
 22142                    b.ToTable("AttachmentStreamInfos");
 22143
 22144                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22145                });
 146
 22147            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 22148                {
 22149                    b.Property<Guid>("Id")
 22150                        .ValueGeneratedOnAdd()
 22151                        .HasColumnType("TEXT");
 22152
 22153                    b.Property<string>("Album")
 22154                        .HasColumnType("TEXT");
 22155
 22156                    b.Property<string>("AlbumArtists")
 22157                        .HasColumnType("TEXT");
 22158
 22159                    b.Property<string>("Artists")
 22160                        .HasColumnType("TEXT");
 22161
 22162                    b.Property<int?>("Audio")
 22163                        .HasColumnType("INTEGER");
 22164
 22165                    b.Property<Guid?>("ChannelId")
 22166                        .HasColumnType("TEXT");
 22167
 22168                    b.Property<string>("CleanName")
 22169                        .HasColumnType("TEXT");
 22170
 22171                    b.Property<float?>("CommunityRating")
 22172                        .HasColumnType("REAL");
 22173
 22174                    b.Property<float?>("CriticRating")
 22175                        .HasColumnType("REAL");
 22176
 22177                    b.Property<string>("CustomRating")
 22178                        .HasColumnType("TEXT");
 22179
 22180                    b.Property<string>("Data")
 22181                        .HasColumnType("TEXT");
 22182
 22183                    b.Property<DateTime?>("DateCreated")
 22184                        .HasColumnType("TEXT");
 22185
 22186                    b.Property<DateTime?>("DateLastMediaAdded")
 22187                        .HasColumnType("TEXT");
 22188
 22189                    b.Property<DateTime?>("DateLastRefreshed")
 22190                        .HasColumnType("TEXT");
 22191
 22192                    b.Property<DateTime?>("DateLastSaved")
 22193                        .HasColumnType("TEXT");
 22194
 22195                    b.Property<DateTime?>("DateModified")
 22196                        .HasColumnType("TEXT");
 22197
 22198                    b.Property<DateTime?>("EndDate")
 22199                        .HasColumnType("TEXT");
 22200
 22201                    b.Property<string>("EpisodeTitle")
 22202                        .HasColumnType("TEXT");
 22203
 22204                    b.Property<string>("ExternalId")
 22205                        .HasColumnType("TEXT");
 22206
 22207                    b.Property<string>("ExternalSeriesId")
 22208                        .HasColumnType("TEXT");
 22209
 22210                    b.Property<string>("ExternalServiceId")
 22211                        .HasColumnType("TEXT");
 22212
 22213                    b.Property<string>("ExtraIds")
 22214                        .HasColumnType("TEXT");
 22215
 22216                    b.Property<int?>("ExtraType")
 22217                        .HasColumnType("INTEGER");
 22218
 22219                    b.Property<string>("ForcedSortName")
 22220                        .HasColumnType("TEXT");
 22221
 22222                    b.Property<string>("Genres")
 22223                        .HasColumnType("TEXT");
 22224
 22225                    b.Property<int?>("Height")
 22226                        .HasColumnType("INTEGER");
 22227
 22228                    b.Property<int?>("IndexNumber")
 22229                        .HasColumnType("INTEGER");
 22230
 22231                    b.Property<int?>("InheritedParentalRatingSubValue")
 22232                        .HasColumnType("INTEGER");
 22233
 22234                    b.Property<int?>("InheritedParentalRatingValue")
 22235                        .HasColumnType("INTEGER");
 22236
 22237                    b.Property<bool>("IsFolder")
 22238                        .HasColumnType("INTEGER");
 22239
 22240                    b.Property<bool>("IsInMixedFolder")
 22241                        .HasColumnType("INTEGER");
 22242
 22243                    b.Property<bool>("IsLocked")
 22244                        .HasColumnType("INTEGER");
 22245
 22246                    b.Property<bool>("IsMovie")
 22247                        .HasColumnType("INTEGER");
 22248
 22249                    b.Property<bool>("IsRepeat")
 22250                        .HasColumnType("INTEGER");
 22251
 22252                    b.Property<bool>("IsSeries")
 22253                        .HasColumnType("INTEGER");
 22254
 22255                    b.Property<bool>("IsVirtualItem")
 22256                        .HasColumnType("INTEGER");
 22257
 22258                    b.Property<float?>("LUFS")
 22259                        .HasColumnType("REAL");
 22260
 22261                    b.Property<string>("MediaType")
 22262                        .HasColumnType("TEXT");
 22263
 22264                    b.Property<string>("Name")
 22265                        .HasColumnType("TEXT");
 22266
 22267                    b.Property<float?>("NormalizationGain")
 22268                        .HasColumnType("REAL");
 22269
 22270                    b.Property<string>("OfficialRating")
 22271                        .HasColumnType("TEXT");
 22272
 22273                    b.Property<string>("OriginalLanguage")
 22274                        .HasColumnType("TEXT");
 22275
 22276                    b.Property<string>("OriginalTitle")
 22277                        .HasColumnType("TEXT");
 22278
 22279                    b.Property<string>("Overview")
 22280                        .HasColumnType("TEXT");
 22281
 22282                    b.Property<Guid?>("OwnerId")
 22283                        .HasColumnType("TEXT");
 22284
 22285                    b.Property<Guid?>("ParentId")
 22286                        .HasColumnType("TEXT");
 22287
 22288                    b.Property<int?>("ParentIndexNumber")
 22289                        .HasColumnType("INTEGER");
 22290
 22291                    b.Property<string>("Path")
 22292                        .HasColumnType("TEXT");
 22293
 22294                    b.Property<string>("PreferredMetadataCountryCode")
 22295                        .HasColumnType("TEXT");
 22296
 22297                    b.Property<string>("PreferredMetadataLanguage")
 22298                        .HasColumnType("TEXT");
 22299
 22300                    b.Property<DateTime?>("PremiereDate")
 22301                        .HasColumnType("TEXT");
 22302
 22303                    b.Property<string>("PresentationUniqueKey")
 22304                        .HasColumnType("TEXT");
 22305
 22306                    b.Property<string>("PrimaryVersionId")
 22307                        .HasColumnType("TEXT");
 22308
 22309                    b.Property<string>("ProductionLocations")
 22310                        .HasColumnType("TEXT");
 22311
 22312                    b.Property<int?>("ProductionYear")
 22313                        .HasColumnType("INTEGER");
 22314
 22315                    b.Property<long?>("RunTimeTicks")
 22316                        .HasColumnType("INTEGER");
 22317
 22318                    b.Property<Guid?>("SeasonId")
 22319                        .HasColumnType("TEXT");
 22320
 22321                    b.Property<string>("SeasonName")
 22322                        .HasColumnType("TEXT");
 22323
 22324                    b.Property<Guid?>("SeriesId")
 22325                        .HasColumnType("TEXT");
 22326
 22327                    b.Property<string>("SeriesName")
 22328                        .HasColumnType("TEXT");
 22329
 22330                    b.Property<string>("SeriesPresentationUniqueKey")
 22331                        .HasColumnType("TEXT");
 22332
 22333                    b.Property<string>("ShowId")
 22334                        .HasColumnType("TEXT");
 22335
 22336                    b.Property<long?>("Size")
 22337                        .HasColumnType("INTEGER");
 22338
 22339                    b.Property<string>("SortName")
 22340                        .HasColumnType("TEXT");
 22341
 22342                    b.Property<DateTime?>("StartDate")
 22343                        .HasColumnType("TEXT");
 22344
 22345                    b.Property<string>("Studios")
 22346                        .HasColumnType("TEXT");
 22347
 22348                    b.Property<string>("Tagline")
 22349                        .HasColumnType("TEXT");
 22350
 22351                    b.Property<string>("Tags")
 22352                        .HasColumnType("TEXT");
 22353
 22354                    b.Property<Guid?>("TopParentId")
 22355                        .HasColumnType("TEXT");
 22356
 22357                    b.Property<int?>("TotalBitrate")
 22358                        .HasColumnType("INTEGER");
 22359
 22360                    b.Property<string>("Type")
 22361                        .IsRequired()
 22362                        .HasColumnType("TEXT");
 22363
 22364                    b.Property<string>("UnratedType")
 22365                        .HasColumnType("TEXT");
 22366
 22367                    b.Property<int?>("Width")
 22368                        .HasColumnType("INTEGER");
 22369
 22370                    b.HasKey("Id");
 22371
 22372                    b.HasIndex("ExtraType");
 22373
 22374                    b.HasIndex("OwnerId");
 22375
 22376                    b.HasIndex("ParentId");
 22377
 22378                    b.HasIndex("Path");
 22379
 22380                    b.HasIndex("PresentationUniqueKey");
 22381
 22382                    b.HasIndex("ExtraType", "OwnerId");
 22383
 22384                    b.HasIndex("TopParentId", "Id");
 22385
 22386                    b.HasIndex("Type", "TopParentId", "Id");
 22387
 22388                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 22389
 22390                    b.HasIndex("Type", "TopParentId", "StartDate");
 22391
 22392                    b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem");
 22393
 22394                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 22395
 22396                    b.HasIndex("TopParentId", "IsFolder", "IsVirtualItem", "DateCreated");
 22397
 22398                    b.HasIndex("TopParentId", "MediaType", "IsVirtualItem", "DateCreated");
 22399
 22400                    b.HasIndex("TopParentId", "Type", "IsVirtualItem", "DateCreated");
 22401
 22402                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 22403
 22404                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 22405
 22406                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 22407
 22408                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 22409
 22410                    b.ToTable("BaseItems");
 22411
 22412                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22413
 22414                    b.HasData(
 22415                        new
 22416                        {
 22417                            Id = new Guid("00000000-0000-0000-0000-000000000001"),
 22418                            IsFolder = false,
 22419                            IsInMixedFolder = false,
 22420                            IsLocked = false,
 22421                            IsMovie = false,
 22422                            IsRepeat = false,
 22423                            IsSeries = false,
 22424                            IsVirtualItem = false,
 22425                            Name = "This is a placeholder item for UserData that has been detached from its original ite
 22426                            Type = "PLACEHOLDER"
 22427                        });
 22428                });
 429
 22430            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 22431                {
 22432                    b.Property<Guid>("Id")
 22433                        .ValueGeneratedOnAdd()
 22434                        .HasColumnType("TEXT");
 22435
 22436                    b.Property<byte[]>("Blurhash")
 22437                        .HasColumnType("BLOB");
 22438
 22439                    b.Property<DateTime?>("DateModified")
 22440                        .HasColumnType("TEXT");
 22441
 22442                    b.Property<int>("Height")
 22443                        .HasColumnType("INTEGER");
 22444
 22445                    b.Property<int>("ImageType")
 22446                        .HasColumnType("INTEGER");
 22447
 22448                    b.Property<Guid>("ItemId")
 22449                        .HasColumnType("TEXT");
 22450
 22451                    b.Property<string>("Path")
 22452                        .IsRequired()
 22453                        .HasColumnType("TEXT");
 22454
 22455                    b.Property<int>("Width")
 22456                        .HasColumnType("INTEGER");
 22457
 22458                    b.HasKey("Id");
 22459
 22460                    b.HasIndex("ItemId");
 22461
 22462                    b.ToTable("BaseItemImageInfos");
 22463
 22464                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22465                });
 466
 22467            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 22468                {
 22469                    b.Property<int>("Id")
 22470                        .HasColumnType("INTEGER");
 22471
 22472                    b.Property<Guid>("ItemId")
 22473                        .HasColumnType("TEXT");
 22474
 22475                    b.HasKey("Id", "ItemId");
 22476
 22477                    b.HasIndex("ItemId");
 22478
 22479                    b.ToTable("BaseItemMetadataFields");
 22480
 22481                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22482                });
 483
 22484            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 22485                {
 22486                    b.Property<Guid>("ItemId")
 22487                        .HasColumnType("TEXT");
 22488
 22489                    b.Property<string>("ProviderId")
 22490                        .HasColumnType("TEXT");
 22491
 22492                    b.Property<string>("ProviderValue")
 22493                        .IsRequired()
 22494                        .HasColumnType("TEXT");
 22495
 22496                    b.HasKey("ItemId", "ProviderId");
 22497
 22498                    b.HasIndex("ProviderId", "ProviderValue", "ItemId");
 22499
 22500                    b.ToTable("BaseItemProviders");
 22501
 22502                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22503                });
 504
 22505            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 22506                {
 22507                    b.Property<int>("Id")
 22508                        .HasColumnType("INTEGER");
 22509
 22510                    b.Property<Guid>("ItemId")
 22511                        .HasColumnType("TEXT");
 22512
 22513                    b.HasKey("Id", "ItemId");
 22514
 22515                    b.HasIndex("ItemId");
 22516
 22517                    b.ToTable("BaseItemTrailerTypes");
 22518
 22519                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22520                });
 521
 22522            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 22523                {
 22524                    b.Property<Guid>("ItemId")
 22525                        .HasColumnType("TEXT");
 22526
 22527                    b.Property<int>("ChapterIndex")
 22528                        .HasColumnType("INTEGER");
 22529
 22530                    b.Property<DateTime?>("ImageDateModified")
 22531                        .HasColumnType("TEXT");
 22532
 22533                    b.Property<string>("ImagePath")
 22534                        .HasColumnType("TEXT");
 22535
 22536                    b.Property<string>("Name")
 22537                        .HasColumnType("TEXT");
 22538
 22539                    b.Property<long>("StartPositionTicks")
 22540                        .HasColumnType("INTEGER");
 22541
 22542                    b.HasKey("ItemId", "ChapterIndex");
 22543
 22544                    b.ToTable("Chapters");
 22545
 22546                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22547                });
 548
 22549            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.CustomItemDisplayPreferences", b =>
 22550                {
 22551                    b.Property<int>("Id")
 22552                        .ValueGeneratedOnAdd()
 22553                        .HasColumnType("INTEGER");
 22554
 22555                    b.Property<string>("Client")
 22556                        .IsRequired()
 22557                        .HasMaxLength(32)
 22558                        .HasColumnType("TEXT");
 22559
 22560                    b.Property<Guid>("ItemId")
 22561                        .HasColumnType("TEXT");
 22562
 22563                    b.Property<string>("Key")
 22564                        .IsRequired()
 22565                        .HasColumnType("TEXT");
 22566
 22567                    b.Property<Guid>("UserId")
 22568                        .HasColumnType("TEXT");
 22569
 22570                    b.Property<string>("Value")
 22571                        .HasColumnType("TEXT");
 22572
 22573                    b.HasKey("Id");
 22574
 22575                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 22576                        .IsUnique();
 22577
 22578                    b.ToTable("CustomItemDisplayPreferences");
 22579
 22580                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22581                });
 582
 22583            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 22584                {
 22585                    b.Property<int>("Id")
 22586                        .ValueGeneratedOnAdd()
 22587                        .HasColumnType("INTEGER");
 22588
 22589                    b.Property<int>("ChromecastVersion")
 22590                        .HasColumnType("INTEGER");
 22591
 22592                    b.Property<string>("Client")
 22593                        .IsRequired()
 22594                        .HasMaxLength(32)
 22595                        .HasColumnType("TEXT");
 22596
 22597                    b.Property<string>("DashboardTheme")
 22598                        .HasMaxLength(32)
 22599                        .HasColumnType("TEXT");
 22600
 22601                    b.Property<bool>("EnableNextVideoInfoOverlay")
 22602                        .HasColumnType("INTEGER");
 22603
 22604                    b.Property<int?>("IndexBy")
 22605                        .HasColumnType("INTEGER");
 22606
 22607                    b.Property<Guid>("ItemId")
 22608                        .HasColumnType("TEXT");
 22609
 22610                    b.Property<int>("ScrollDirection")
 22611                        .HasColumnType("INTEGER");
 22612
 22613                    b.Property<bool>("ShowBackdrop")
 22614                        .HasColumnType("INTEGER");
 22615
 22616                    b.Property<bool>("ShowSidebar")
 22617                        .HasColumnType("INTEGER");
 22618
 22619                    b.Property<int>("SkipBackwardLength")
 22620                        .HasColumnType("INTEGER");
 22621
 22622                    b.Property<int>("SkipForwardLength")
 22623                        .HasColumnType("INTEGER");
 22624
 22625                    b.Property<string>("TvHome")
 22626                        .HasMaxLength(32)
 22627                        .HasColumnType("TEXT");
 22628
 22629                    b.Property<Guid>("UserId")
 22630                        .HasColumnType("TEXT");
 22631
 22632                    b.HasKey("Id");
 22633
 22634                    b.HasIndex("UserId", "ItemId", "Client")
 22635                        .IsUnique();
 22636
 22637                    b.ToTable("DisplayPreferences");
 22638
 22639                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22640                });
 641
 22642            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 22643                {
 22644                    b.Property<int>("Id")
 22645                        .ValueGeneratedOnAdd()
 22646                        .HasColumnType("INTEGER");
 22647
 22648                    b.Property<int>("DisplayPreferencesId")
 22649                        .HasColumnType("INTEGER");
 22650
 22651                    b.Property<int>("Order")
 22652                        .HasColumnType("INTEGER");
 22653
 22654                    b.Property<int>("Type")
 22655                        .HasColumnType("INTEGER");
 22656
 22657                    b.HasKey("Id");
 22658
 22659                    b.HasIndex("DisplayPreferencesId");
 22660
 22661                    b.ToTable("HomeSection");
 22662
 22663                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22664                });
 665
 22666            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 22667                {
 22668                    b.Property<int>("Id")
 22669                        .ValueGeneratedOnAdd()
 22670                        .HasColumnType("INTEGER");
 22671
 22672                    b.Property<DateTime>("LastModified")
 22673                        .HasColumnType("TEXT");
 22674
 22675                    b.Property<string>("Path")
 22676                        .IsRequired()
 22677                        .HasMaxLength(512)
 22678                        .HasColumnType("TEXT");
 22679
 22680                    b.Property<Guid?>("UserId")
 22681                        .HasColumnType("TEXT");
 22682
 22683                    b.HasKey("Id");
 22684
 22685                    b.HasIndex("UserId")
 22686                        .IsUnique();
 22687
 22688                    b.ToTable("ImageInfos");
 22689
 22690                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22691                });
 692
 22693            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 22694                {
 22695                    b.Property<int>("Id")
 22696                        .ValueGeneratedOnAdd()
 22697                        .HasColumnType("INTEGER");
 22698
 22699                    b.Property<string>("Client")
 22700                        .IsRequired()
 22701                        .HasMaxLength(32)
 22702                        .HasColumnType("TEXT");
 22703
 22704                    b.Property<int?>("IndexBy")
 22705                        .HasColumnType("INTEGER");
 22706
 22707                    b.Property<Guid>("ItemId")
 22708                        .HasColumnType("TEXT");
 22709
 22710                    b.Property<bool>("RememberIndexing")
 22711                        .HasColumnType("INTEGER");
 22712
 22713                    b.Property<bool>("RememberSorting")
 22714                        .HasColumnType("INTEGER");
 22715
 22716                    b.Property<string>("SortBy")
 22717                        .IsRequired()
 22718                        .HasMaxLength(64)
 22719                        .HasColumnType("TEXT");
 22720
 22721                    b.Property<int>("SortOrder")
 22722                        .HasColumnType("INTEGER");
 22723
 22724                    b.Property<Guid>("UserId")
 22725                        .HasColumnType("TEXT");
 22726
 22727                    b.Property<int>("ViewType")
 22728                        .HasColumnType("INTEGER");
 22729
 22730                    b.HasKey("Id");
 22731
 22732                    b.HasIndex("UserId");
 22733
 22734                    b.ToTable("ItemDisplayPreferences");
 22735
 22736                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22737                });
 738
 22739            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 22740                {
 22741                    b.Property<Guid>("ItemValueId")
 22742                        .ValueGeneratedOnAdd()
 22743                        .HasColumnType("TEXT");
 22744
 22745                    b.Property<string>("CleanValue")
 22746                        .IsRequired()
 22747                        .HasColumnType("TEXT");
 22748
 22749                    b.Property<int>("Type")
 22750                        .HasColumnType("INTEGER");
 22751
 22752                    b.Property<string>("Value")
 22753                        .IsRequired()
 22754                        .HasColumnType("TEXT");
 22755
 22756                    b.HasKey("ItemValueId");
 22757
 22758                    b.HasIndex("Type", "CleanValue");
 22759
 22760                    b.HasIndex("Type", "Value")
 22761                        .IsUnique();
 22762
 22763                    b.ToTable("ItemValues");
 22764
 22765                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22766                });
 767
 22768            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 22769                {
 22770                    b.Property<Guid>("ItemValueId")
 22771                        .HasColumnType("TEXT");
 22772
 22773                    b.Property<Guid>("ItemId")
 22774                        .HasColumnType("TEXT");
 22775
 22776                    b.HasKey("ItemValueId", "ItemId");
 22777
 22778                    b.HasIndex("ItemId");
 22779
 22780                    b.ToTable("ItemValuesMap");
 22781
 22782                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22783                });
 784
 22785            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 22786                {
 22787                    b.Property<Guid>("ItemId")
 22788                        .HasColumnType("TEXT");
 22789
 22790                    b.PrimitiveCollection<string>("KeyframeTicks")
 22791                        .HasColumnType("TEXT");
 22792
 22793                    b.Property<long>("TotalDuration")
 22794                        .HasColumnType("INTEGER");
 22795
 22796                    b.HasKey("ItemId");
 22797
 22798                    b.ToTable("KeyframeData");
 22799
 22800                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22801                });
 802
 22803            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 22804                {
 22805                    b.Property<Guid>("ParentId")
 22806                        .HasColumnType("TEXT");
 22807
 22808                    b.Property<Guid>("ChildId")
 22809                        .HasColumnType("TEXT");
 22810
 22811                    b.Property<int>("ChildType")
 22812                        .HasColumnType("INTEGER");
 22813
 22814                    b.Property<int?>("SortOrder")
 22815                        .HasColumnType("INTEGER");
 22816
 22817                    b.HasKey("ParentId", "ChildId");
 22818
 22819                    b.HasIndex("ChildId");
 22820
 22821                    b.HasIndex("ParentId");
 22822
 22823                    b.HasIndex("ChildId", "ChildType");
 22824
 22825                    b.HasIndex("ParentId", "ChildType");
 22826
 22827                    b.HasIndex("ParentId", "SortOrder");
 22828
 22829                    b.ToTable("LinkedChildren", (string)null);
 22830
 22831                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22832                });
 833
 22834            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaSegment", b =>
 22835                {
 22836                    b.Property<Guid>("Id")
 22837                        .ValueGeneratedOnAdd()
 22838                        .HasColumnType("TEXT");
 22839
 22840                    b.Property<long>("EndTicks")
 22841                        .HasColumnType("INTEGER");
 22842
 22843                    b.Property<Guid>("ItemId")
 22844                        .HasColumnType("TEXT");
 22845
 22846                    b.Property<string>("SegmentProviderId")
 22847                        .IsRequired()
 22848                        .HasColumnType("TEXT");
 22849
 22850                    b.Property<long>("StartTicks")
 22851                        .HasColumnType("INTEGER");
 22852
 22853                    b.Property<int>("Type")
 22854                        .HasColumnType("INTEGER");
 22855
 22856                    b.HasKey("Id");
 22857
 22858                    b.ToTable("MediaSegments");
 22859
 22860                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22861                });
 862
 22863            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 22864                {
 22865                    b.Property<Guid>("ItemId")
 22866                        .HasColumnType("TEXT");
 22867
 22868                    b.Property<int>("StreamIndex")
 22869                        .HasColumnType("INTEGER");
 22870
 22871                    b.Property<string>("AspectRatio")
 22872                        .HasColumnType("TEXT");
 22873
 22874                    b.Property<float?>("AverageFrameRate")
 22875                        .HasColumnType("REAL");
 22876
 22877                    b.Property<int?>("BitDepth")
 22878                        .HasColumnType("INTEGER");
 22879
 22880                    b.Property<int?>("BitRate")
 22881                        .HasColumnType("INTEGER");
 22882
 22883                    b.Property<int?>("BlPresentFlag")
 22884                        .HasColumnType("INTEGER");
 22885
 22886                    b.Property<string>("ChannelLayout")
 22887                        .HasColumnType("TEXT");
 22888
 22889                    b.Property<int?>("Channels")
 22890                        .HasColumnType("INTEGER");
 22891
 22892                    b.Property<string>("Codec")
 22893                        .HasColumnType("TEXT");
 22894
 22895                    b.Property<string>("CodecTag")
 22896                        .HasColumnType("TEXT");
 22897
 22898                    b.Property<string>("CodecTimeBase")
 22899                        .HasColumnType("TEXT");
 22900
 22901                    b.Property<string>("ColorPrimaries")
 22902                        .HasColumnType("TEXT");
 22903
 22904                    b.Property<string>("ColorSpace")
 22905                        .HasColumnType("TEXT");
 22906
 22907                    b.Property<string>("ColorTransfer")
 22908                        .HasColumnType("TEXT");
 22909
 22910                    b.Property<string>("Comment")
 22911                        .HasColumnType("TEXT");
 22912
 22913                    b.Property<int?>("DvBlSignalCompatibilityId")
 22914                        .HasColumnType("INTEGER");
 22915
 22916                    b.Property<int?>("DvLevel")
 22917                        .HasColumnType("INTEGER");
 22918
 22919                    b.Property<int?>("DvProfile")
 22920                        .HasColumnType("INTEGER");
 22921
 22922                    b.Property<int?>("DvVersionMajor")
 22923                        .HasColumnType("INTEGER");
 22924
 22925                    b.Property<int?>("DvVersionMinor")
 22926                        .HasColumnType("INTEGER");
 22927
 22928                    b.Property<int?>("ElPresentFlag")
 22929                        .HasColumnType("INTEGER");
 22930
 22931                    b.Property<bool?>("Hdr10PlusPresentFlag")
 22932                        .HasColumnType("INTEGER");
 22933
 22934                    b.Property<int?>("Height")
 22935                        .HasColumnType("INTEGER");
 22936
 22937                    b.Property<bool?>("IsAnamorphic")
 22938                        .HasColumnType("INTEGER");
 22939
 22940                    b.Property<bool?>("IsAvc")
 22941                        .HasColumnType("INTEGER");
 22942
 22943                    b.Property<bool>("IsDefault")
 22944                        .HasColumnType("INTEGER");
 22945
 22946                    b.Property<bool>("IsExternal")
 22947                        .HasColumnType("INTEGER");
 22948
 22949                    b.Property<bool>("IsForced")
 22950                        .HasColumnType("INTEGER");
 22951
 22952                    b.Property<bool?>("IsHearingImpaired")
 22953                        .HasColumnType("INTEGER");
 22954
 22955                    b.Property<bool?>("IsInterlaced")
 22956                        .HasColumnType("INTEGER");
 22957
 22958                    b.Property<bool>("IsOriginal")
 22959                        .HasColumnType("INTEGER");
 22960
 22961                    b.Property<string>("KeyFrames")
 22962                        .HasColumnType("TEXT");
 22963
 22964                    b.Property<string>("Language")
 22965                        .HasColumnType("TEXT");
 22966
 22967                    b.Property<float?>("Level")
 22968                        .HasColumnType("REAL");
 22969
 22970                    b.Property<string>("NalLengthSize")
 22971                        .HasColumnType("TEXT");
 22972
 22973                    b.Property<string>("Path")
 22974                        .HasColumnType("TEXT");
 22975
 22976                    b.Property<string>("PixelFormat")
 22977                        .HasColumnType("TEXT");
 22978
 22979                    b.Property<string>("Profile")
 22980                        .HasColumnType("TEXT");
 22981
 22982                    b.Property<float?>("RealFrameRate")
 22983                        .HasColumnType("REAL");
 22984
 22985                    b.Property<int?>("RefFrames")
 22986                        .HasColumnType("INTEGER");
 22987
 22988                    b.Property<int?>("Rotation")
 22989                        .HasColumnType("INTEGER");
 22990
 22991                    b.Property<int?>("RpuPresentFlag")
 22992                        .HasColumnType("INTEGER");
 22993
 22994                    b.Property<int?>("SampleRate")
 22995                        .HasColumnType("INTEGER");
 22996
 22997                    b.Property<int>("StreamType")
 22998                        .HasColumnType("INTEGER");
 22999
 221000                    b.Property<string>("TimeBase")
 221001                        .HasColumnType("TEXT");
 221002
 221003                    b.Property<string>("Title")
 221004                        .HasColumnType("TEXT");
 221005
 221006                    b.Property<int?>("Width")
 221007                        .HasColumnType("INTEGER");
 221008
 221009                    b.HasKey("ItemId", "StreamIndex");
 221010
 221011                    b.HasIndex("StreamIndex");
 221012
 221013                    b.HasIndex("StreamType");
 221014
 221015                    b.HasIndex("StreamIndex", "StreamType");
 221016
 221017                    b.HasIndex("StreamIndex", "StreamType", "Language");
 221018
 221019                    b.ToTable("MediaStreamInfos");
 221020
 221021                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221022                });
 1023
 221024            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 221025                {
 221026                    b.Property<Guid>("Id")
 221027                        .ValueGeneratedOnAdd()
 221028                        .HasColumnType("TEXT");
 221029
 221030                    b.Property<string>("Name")
 221031                        .IsRequired()
 221032                        .HasColumnType("TEXT");
 221033
 221034                    b.Property<string>("PersonType")
 221035                        .HasColumnType("TEXT");
 221036
 221037                    b.HasKey("Id");
 221038
 221039                    b.HasIndex("Name");
 221040
 221041                    b.ToTable("Peoples");
 221042
 221043                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221044                });
 1045
 221046            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 221047                {
 221048                    b.Property<Guid>("ItemId")
 221049                        .HasColumnType("TEXT");
 221050
 221051                    b.Property<Guid>("PeopleId")
 221052                        .HasColumnType("TEXT");
 221053
 221054                    b.Property<string>("Role")
 221055                        .HasColumnType("TEXT");
 221056
 221057                    b.Property<int?>("ListOrder")
 221058                        .HasColumnType("INTEGER");
 221059
 221060                    b.Property<int?>("SortOrder")
 221061                        .HasColumnType("INTEGER");
 221062
 221063                    b.HasKey("ItemId", "PeopleId", "Role");
 221064
 221065                    b.HasIndex("PeopleId");
 221066
 221067                    b.HasIndex("ItemId", "ListOrder");
 221068
 221069                    b.HasIndex("ItemId", "SortOrder");
 221070
 221071                    b.ToTable("PeopleBaseItemMap");
 221072
 221073                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221074                });
 1075
 221076            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 221077                {
 221078                    b.Property<int>("Id")
 221079                        .ValueGeneratedOnAdd()
 221080                        .HasColumnType("INTEGER");
 221081
 221082                    b.Property<int>("Kind")
 221083                        .HasColumnType("INTEGER");
 221084
 221085                    b.Property<Guid?>("Permission_Permissions_Guid")
 221086                        .HasColumnType("TEXT");
 221087
 221088                    b.Property<uint>("RowVersion")
 221089                        .IsConcurrencyToken()
 221090                        .HasColumnType("INTEGER");
 221091
 221092                    b.Property<Guid?>("UserId")
 221093                        .HasColumnType("TEXT");
 221094
 221095                    b.Property<bool>("Value")
 221096                        .HasColumnType("INTEGER");
 221097
 221098                    b.HasKey("Id");
 221099
 221100                    b.HasIndex("UserId", "Kind")
 221101                        .IsUnique()
 221102                        .HasFilter("[UserId] IS NOT NULL");
 221103
 221104                    b.ToTable("Permissions");
 221105
 221106                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221107                });
 1108
 221109            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 221110                {
 221111                    b.Property<int>("Id")
 221112                        .ValueGeneratedOnAdd()
 221113                        .HasColumnType("INTEGER");
 221114
 221115                    b.Property<int>("Kind")
 221116                        .HasColumnType("INTEGER");
 221117
 221118                    b.Property<Guid?>("Preference_Preferences_Guid")
 221119                        .HasColumnType("TEXT");
 221120
 221121                    b.Property<uint>("RowVersion")
 221122                        .IsConcurrencyToken()
 221123                        .HasColumnType("INTEGER");
 221124
 221125                    b.Property<Guid?>("UserId")
 221126                        .HasColumnType("TEXT");
 221127
 221128                    b.Property<string>("Value")
 221129                        .IsRequired()
 221130                        .HasMaxLength(65535)
 221131                        .HasColumnType("TEXT");
 221132
 221133                    b.HasKey("Id");
 221134
 221135                    b.HasIndex("UserId", "Kind")
 221136                        .IsUnique()
 221137                        .HasFilter("[UserId] IS NOT NULL");
 221138
 221139                    b.ToTable("Preferences");
 221140
 221141                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221142                });
 1143
 221144            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.ApiKey", b =>
 221145                {
 221146                    b.Property<int>("Id")
 221147                        .ValueGeneratedOnAdd()
 221148                        .HasColumnType("INTEGER");
 221149
 221150                    b.Property<string>("AccessToken")
 221151                        .IsRequired()
 221152                        .HasColumnType("TEXT");
 221153
 221154                    b.Property<DateTime>("DateCreated")
 221155                        .HasColumnType("TEXT");
 221156
 221157                    b.Property<DateTime>("DateLastActivity")
 221158                        .HasColumnType("TEXT");
 221159
 221160                    b.Property<string>("Name")
 221161                        .IsRequired()
 221162                        .HasMaxLength(64)
 221163                        .HasColumnType("TEXT");
 221164
 221165                    b.HasKey("Id");
 221166
 221167                    b.HasIndex("AccessToken")
 221168                        .IsUnique();
 221169
 221170                    b.ToTable("ApiKeys");
 221171
 221172                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221173                });
 1174
 221175            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 221176                {
 221177                    b.Property<int>("Id")
 221178                        .ValueGeneratedOnAdd()
 221179                        .HasColumnType("INTEGER");
 221180
 221181                    b.Property<string>("AccessToken")
 221182                        .IsRequired()
 221183                        .HasColumnType("TEXT");
 221184
 221185                    b.Property<string>("AppName")
 221186                        .IsRequired()
 221187                        .HasMaxLength(64)
 221188                        .HasColumnType("TEXT");
 221189
 221190                    b.Property<string>("AppVersion")
 221191                        .IsRequired()
 221192                        .HasMaxLength(32)
 221193                        .HasColumnType("TEXT");
 221194
 221195                    b.Property<DateTime>("DateCreated")
 221196                        .HasColumnType("TEXT");
 221197
 221198                    b.Property<DateTime>("DateLastActivity")
 221199                        .HasColumnType("TEXT");
 221200
 221201                    b.Property<DateTime>("DateModified")
 221202                        .HasColumnType("TEXT");
 221203
 221204                    b.Property<string>("DeviceId")
 221205                        .IsRequired()
 221206                        .HasMaxLength(256)
 221207                        .HasColumnType("TEXT");
 221208
 221209                    b.Property<string>("DeviceName")
 221210                        .IsRequired()
 221211                        .HasMaxLength(64)
 221212                        .HasColumnType("TEXT");
 221213
 221214                    b.Property<bool>("IsActive")
 221215                        .HasColumnType("INTEGER");
 221216
 221217                    b.Property<Guid>("UserId")
 221218                        .HasColumnType("TEXT");
 221219
 221220                    b.HasKey("Id");
 221221
 221222                    b.HasIndex("DeviceId");
 221223
 221224                    b.HasIndex("AccessToken", "DateLastActivity");
 221225
 221226                    b.HasIndex("DeviceId", "DateLastActivity");
 221227
 221228                    b.HasIndex("UserId", "DeviceId");
 221229
 221230                    b.ToTable("Devices");
 221231
 221232                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221233                });
 1234
 221235            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.DeviceOptions", b =>
 221236                {
 221237                    b.Property<int>("Id")
 221238                        .ValueGeneratedOnAdd()
 221239                        .HasColumnType("INTEGER");
 221240
 221241                    b.Property<string>("CustomName")
 221242                        .HasColumnType("TEXT");
 221243
 221244                    b.Property<string>("DeviceId")
 221245                        .IsRequired()
 221246                        .HasColumnType("TEXT");
 221247
 221248                    b.HasKey("Id");
 221249
 221250                    b.HasIndex("DeviceId")
 221251                        .IsUnique();
 221252
 221253                    b.ToTable("DeviceOptions");
 221254
 221255                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221256                });
 1257
 221258            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.TrickplayInfo", b =>
 221259                {
 221260                    b.Property<Guid>("ItemId")
 221261                        .HasColumnType("TEXT");
 221262
 221263                    b.Property<int>("Width")
 221264                        .HasColumnType("INTEGER");
 221265
 221266                    b.Property<int>("Bandwidth")
 221267                        .HasColumnType("INTEGER");
 221268
 221269                    b.Property<int>("Height")
 221270                        .HasColumnType("INTEGER");
 221271
 221272                    b.Property<int>("Interval")
 221273                        .HasColumnType("INTEGER");
 221274
 221275                    b.Property<int>("ThumbnailCount")
 221276                        .HasColumnType("INTEGER");
 221277
 221278                    b.Property<int>("TileHeight")
 221279                        .HasColumnType("INTEGER");
 221280
 221281                    b.Property<int>("TileWidth")
 221282                        .HasColumnType("INTEGER");
 221283
 221284                    b.HasKey("ItemId", "Width");
 221285
 221286                    b.ToTable("TrickplayInfos");
 221287
 221288                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221289                });
 1290
 221291            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 221292                {
 221293                    b.Property<Guid>("Id")
 221294                        .ValueGeneratedOnAdd()
 221295                        .HasColumnType("TEXT");
 221296
 221297                    b.Property<string>("AudioLanguagePreference")
 221298                        .HasMaxLength(255)
 221299                        .HasColumnType("TEXT");
 221300
 221301                    b.Property<string>("AuthenticationProviderId")
 221302                        .IsRequired()
 221303                        .HasMaxLength(255)
 221304                        .HasColumnType("TEXT");
 221305
 221306                    b.Property<string>("CastReceiverId")
 221307                        .HasMaxLength(32)
 221308                        .HasColumnType("TEXT");
 221309
 221310                    b.Property<bool>("DisplayCollectionsView")
 221311                        .HasColumnType("INTEGER");
 221312
 221313                    b.Property<bool>("DisplayMissingEpisodes")
 221314                        .HasColumnType("INTEGER");
 221315
 221316                    b.Property<bool>("EnableAutoLogin")
 221317                        .HasColumnType("INTEGER");
 221318
 221319                    b.Property<bool>("EnableLocalPassword")
 221320                        .HasColumnType("INTEGER");
 221321
 221322                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 221323                        .HasColumnType("INTEGER");
 221324
 221325                    b.Property<bool>("EnableUserPreferenceAccess")
 221326                        .HasColumnType("INTEGER");
 221327
 221328                    b.Property<bool>("HidePlayedInLatest")
 221329                        .HasColumnType("INTEGER");
 221330
 221331                    b.Property<long>("InternalId")
 221332                        .HasColumnType("INTEGER");
 221333
 221334                    b.Property<int>("InvalidLoginAttemptCount")
 221335                        .HasColumnType("INTEGER");
 221336
 221337                    b.Property<DateTime?>("LastActivityDate")
 221338                        .HasColumnType("TEXT");
 221339
 221340                    b.Property<DateTime?>("LastLoginDate")
 221341                        .HasColumnType("TEXT");
 221342
 221343                    b.Property<int?>("LoginAttemptsBeforeLockout")
 221344                        .HasColumnType("INTEGER");
 221345
 221346                    b.Property<int>("MaxActiveSessions")
 221347                        .HasColumnType("INTEGER");
 221348
 221349                    b.Property<int?>("MaxParentalRatingScore")
 221350                        .HasColumnType("INTEGER");
 221351
 221352                    b.Property<int?>("MaxParentalRatingSubScore")
 221353                        .HasColumnType("INTEGER");
 221354
 221355                    b.Property<bool>("MustUpdatePassword")
 221356                        .HasColumnType("INTEGER");
 221357
 221358                    b.Property<string>("Password")
 221359                        .HasMaxLength(65535)
 221360                        .HasColumnType("TEXT");
 221361
 221362                    b.Property<string>("PasswordResetProviderId")
 221363                        .IsRequired()
 221364                        .HasMaxLength(255)
 221365                        .HasColumnType("TEXT");
 221366
 221367                    b.Property<bool>("PlayDefaultAudioTrack")
 221368                        .HasColumnType("INTEGER");
 221369
 221370                    b.Property<bool>("RememberAudioSelections")
 221371                        .HasColumnType("INTEGER");
 221372
 221373                    b.Property<bool>("RememberSubtitleSelections")
 221374                        .HasColumnType("INTEGER");
 221375
 221376                    b.Property<int?>("RemoteClientBitrateLimit")
 221377                        .HasColumnType("INTEGER");
 221378
 221379                    b.Property<uint>("RowVersion")
 221380                        .IsConcurrencyToken()
 221381                        .HasColumnType("INTEGER");
 221382
 221383                    b.Property<string>("SubtitleLanguagePreference")
 221384                        .HasMaxLength(255)
 221385                        .HasColumnType("TEXT");
 221386
 221387                    b.Property<int>("SubtitleMode")
 221388                        .HasColumnType("INTEGER");
 221389
 221390                    b.Property<int>("SyncPlayAccess")
 221391                        .HasColumnType("INTEGER");
 221392
 221393                    b.Property<string>("Username")
 221394                        .IsRequired()
 221395                        .HasMaxLength(255)
 221396                        .HasColumnType("TEXT");
 221397
 221398                    b.HasKey("Id");
 221399
 221400                    b.HasIndex("Username")
 221401                        .IsUnique();
 221402
 221403                    b.ToTable("Users");
 221404
 221405                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221406                });
 1407
 221408            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 221409                {
 221410                    b.Property<Guid>("ItemId")
 221411                        .HasColumnType("TEXT");
 221412
 221413                    b.Property<Guid>("UserId")
 221414                        .HasColumnType("TEXT");
 221415
 221416                    b.Property<string>("CustomDataKey")
 221417                        .HasColumnType("TEXT");
 221418
 221419                    b.Property<int?>("AudioStreamIndex")
 221420                        .HasColumnType("INTEGER");
 221421
 221422                    b.Property<bool>("IsFavorite")
 221423                        .HasColumnType("INTEGER");
 221424
 221425                    b.Property<DateTime?>("LastPlayedDate")
 221426                        .HasColumnType("TEXT");
 221427
 221428                    b.Property<bool?>("Likes")
 221429                        .HasColumnType("INTEGER");
 221430
 221431                    b.Property<int>("PlayCount")
 221432                        .HasColumnType("INTEGER");
 221433
 221434                    b.Property<long>("PlaybackPositionTicks")
 221435                        .HasColumnType("INTEGER");
 221436
 221437                    b.Property<bool>("Played")
 221438                        .HasColumnType("INTEGER");
 221439
 221440                    b.Property<double?>("Rating")
 221441                        .HasColumnType("REAL");
 221442
 221443                    b.Property<DateTime?>("RetentionDate")
 221444                        .HasColumnType("TEXT");
 221445
 221446                    b.Property<int?>("SubtitleStreamIndex")
 221447                        .HasColumnType("INTEGER");
 221448
 221449                    b.HasKey("ItemId", "UserId", "CustomDataKey");
 221450
 221451                    b.HasIndex("UserId");
 221452
 221453                    b.HasIndex("ItemId", "UserId", "IsFavorite");
 221454
 221455                    b.HasIndex("ItemId", "UserId", "LastPlayedDate");
 221456
 221457                    b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
 221458
 221459                    b.HasIndex("ItemId", "UserId", "Played");
 221460
 221461                    b.ToTable("UserData");
 221462
 221463                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221464                });
 1465
 221466            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 221467                {
 221468                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221469                        .WithMany("AccessSchedules")
 221470                        .HasForeignKey("UserId")
 221471                        .OnDelete(DeleteBehavior.Cascade)
 221472                        .IsRequired();
 221473                });
 1474
 221475            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 221476                {
 221477                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221478                        .WithMany("Parents")
 221479                        .HasForeignKey("ItemId")
 221480                        .OnDelete(DeleteBehavior.Cascade)
 221481                        .IsRequired();
 221482
 221483                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "ParentItem")
 221484                        .WithMany("Children")
 221485                        .HasForeignKey("ParentItemId")
 221486                        .OnDelete(DeleteBehavior.Cascade)
 221487                        .IsRequired();
 221488
 221489                    b.Navigation("Item");
 221490
 221491                    b.Navigation("ParentItem");
 221492                });
 1493
 221494            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 221495                {
 221496                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221497                        .WithMany()
 221498                        .HasForeignKey("ItemId")
 221499                        .OnDelete(DeleteBehavior.Cascade)
 221500                        .IsRequired();
 221501
 221502                    b.Navigation("Item");
 221503                });
 1504
 221505            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 221506                {
 221507                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Owner")
 221508                        .WithMany("Extras")
 221509                        .HasForeignKey("OwnerId")
 221510                        .OnDelete(DeleteBehavior.NoAction);
 221511
 221512                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "DirectParent")
 221513                        .WithMany("DirectChildren")
 221514                        .HasForeignKey("ParentId")
 221515                        .OnDelete(DeleteBehavior.Cascade);
 221516
 221517                    b.Navigation("DirectParent");
 221518
 221519                    b.Navigation("Owner");
 221520                });
 1521
 221522            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 221523                {
 221524                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221525                        .WithMany("Images")
 221526                        .HasForeignKey("ItemId")
 221527                        .OnDelete(DeleteBehavior.Cascade)
 221528                        .IsRequired();
 221529
 221530                    b.Navigation("Item");
 221531                });
 1532
 221533            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 221534                {
 221535                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221536                        .WithMany("LockedFields")
 221537                        .HasForeignKey("ItemId")
 221538                        .OnDelete(DeleteBehavior.Cascade)
 221539                        .IsRequired();
 221540
 221541                    b.Navigation("Item");
 221542                });
 1543
 221544            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 221545                {
 221546                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221547                        .WithMany("Provider")
 221548                        .HasForeignKey("ItemId")
 221549                        .OnDelete(DeleteBehavior.Cascade)
 221550                        .IsRequired();
 221551
 221552                    b.Navigation("Item");
 221553                });
 1554
 221555            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 221556                {
 221557                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221558                        .WithMany("TrailerTypes")
 221559                        .HasForeignKey("ItemId")
 221560                        .OnDelete(DeleteBehavior.Cascade)
 221561                        .IsRequired();
 221562
 221563                    b.Navigation("Item");
 221564                });
 1565
 221566            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 221567                {
 221568                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221569                        .WithMany("Chapters")
 221570                        .HasForeignKey("ItemId")
 221571                        .OnDelete(DeleteBehavior.Cascade)
 221572                        .IsRequired();
 221573
 221574                    b.Navigation("Item");
 221575                });
 1576
 221577            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 221578                {
 221579                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221580                        .WithMany("DisplayPreferences")
 221581                        .HasForeignKey("UserId")
 221582                        .OnDelete(DeleteBehavior.Cascade)
 221583                        .IsRequired();
 221584                });
 1585
 221586            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 221587                {
 221588                    b.HasOne("Jellyfin.Database.Implementations.Entities.DisplayPreferences", null)
 221589                        .WithMany("HomeSections")
 221590                        .HasForeignKey("DisplayPreferencesId")
 221591                        .OnDelete(DeleteBehavior.Cascade)
 221592                        .IsRequired();
 221593                });
 1594
 221595            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 221596                {
 221597                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221598                        .WithOne("ProfileImage")
 221599                        .HasForeignKey("Jellyfin.Database.Implementations.Entities.ImageInfo", "UserId")
 221600                        .OnDelete(DeleteBehavior.Cascade);
 221601                });
 1602
 221603            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 221604                {
 221605                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221606                        .WithMany("ItemDisplayPreferences")
 221607                        .HasForeignKey("UserId")
 221608                        .OnDelete(DeleteBehavior.Cascade)
 221609                        .IsRequired();
 221610                });
 1611
 221612            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 221613                {
 221614                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221615                        .WithMany("ItemValues")
 221616                        .HasForeignKey("ItemId")
 221617                        .OnDelete(DeleteBehavior.Cascade)
 221618                        .IsRequired();
 221619
 221620                    b.HasOne("Jellyfin.Database.Implementations.Entities.ItemValue", "ItemValue")
 221621                        .WithMany("BaseItemsMap")
 221622                        .HasForeignKey("ItemValueId")
 221623                        .OnDelete(DeleteBehavior.Cascade)
 221624                        .IsRequired();
 221625
 221626                    b.Navigation("Item");
 221627
 221628                    b.Navigation("ItemValue");
 221629                });
 1630
 221631            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 221632                {
 221633                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221634                        .WithMany()
 221635                        .HasForeignKey("ItemId")
 221636                        .OnDelete(DeleteBehavior.Cascade)
 221637                        .IsRequired();
 221638
 221639                    b.Navigation("Item");
 221640                });
 1641
 221642            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 221643                {
 221644                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Child")
 221645                        .WithMany("LinkedChildOfEntities")
 221646                        .HasForeignKey("ChildId")
 221647                        .OnDelete(DeleteBehavior.NoAction)
 221648                        .IsRequired();
 221649
 221650                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Parent")
 221651                        .WithMany("LinkedChildEntities")
 221652                        .HasForeignKey("ParentId")
 221653                        .OnDelete(DeleteBehavior.NoAction)
 221654                        .IsRequired();
 221655
 221656                    b.Navigation("Child");
 221657
 221658                    b.Navigation("Parent");
 221659                });
 1660
 221661            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 221662                {
 221663                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221664                        .WithMany("MediaStreams")
 221665                        .HasForeignKey("ItemId")
 221666                        .OnDelete(DeleteBehavior.Cascade)
 221667                        .IsRequired();
 221668
 221669                    b.Navigation("Item");
 221670                });
 1671
 221672            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 221673                {
 221674                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221675                        .WithMany("Peoples")
 221676                        .HasForeignKey("ItemId")
 221677                        .OnDelete(DeleteBehavior.Cascade)
 221678                        .IsRequired();
 221679
 221680                    b.HasOne("Jellyfin.Database.Implementations.Entities.People", "People")
 221681                        .WithMany("BaseItems")
 221682                        .HasForeignKey("PeopleId")
 221683                        .OnDelete(DeleteBehavior.Cascade)
 221684                        .IsRequired();
 221685
 221686                    b.Navigation("Item");
 221687
 221688                    b.Navigation("People");
 221689                });
 1690
 221691            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 221692                {
 221693                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221694                        .WithMany("Permissions")
 221695                        .HasForeignKey("UserId")
 221696                        .OnDelete(DeleteBehavior.Cascade);
 221697                });
 1698
 221699            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 221700                {
 221701                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221702                        .WithMany("Preferences")
 221703                        .HasForeignKey("UserId")
 221704                        .OnDelete(DeleteBehavior.Cascade);
 221705                });
 1706
 221707            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 221708                {
 221709                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 221710                        .WithMany()
 221711                        .HasForeignKey("UserId")
 221712                        .OnDelete(DeleteBehavior.Cascade)
 221713                        .IsRequired();
 221714
 221715                    b.Navigation("User");
 221716                });
 1717
 221718            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 221719                {
 221720                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221721                        .WithMany("UserData")
 221722                        .HasForeignKey("ItemId")
 221723                        .OnDelete(DeleteBehavior.Cascade)
 221724                        .IsRequired();
 221725
 221726                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 221727                        .WithMany()
 221728                        .HasForeignKey("UserId")
 221729                        .OnDelete(DeleteBehavior.Cascade)
 221730                        .IsRequired();
 221731
 221732                    b.Navigation("Item");
 221733
 221734                    b.Navigation("User");
 221735                });
 1736
 221737            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 221738                {
 221739                    b.Navigation("Chapters");
 221740
 221741                    b.Navigation("Children");
 221742
 221743                    b.Navigation("DirectChildren");
 221744
 221745                    b.Navigation("Extras");
 221746
 221747                    b.Navigation("Images");
 221748
 221749                    b.Navigation("ItemValues");
 221750
 221751                    b.Navigation("LinkedChildEntities");
 221752
 221753                    b.Navigation("LinkedChildOfEntities");
 221754
 221755                    b.Navigation("LockedFields");
 221756
 221757                    b.Navigation("MediaStreams");
 221758
 221759                    b.Navigation("Parents");
 221760
 221761                    b.Navigation("Peoples");
 221762
 221763                    b.Navigation("Provider");
 221764
 221765                    b.Navigation("TrailerTypes");
 221766
 221767                    b.Navigation("UserData");
 221768                });
 1769
 221770            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 221771                {
 221772                    b.Navigation("HomeSections");
 221773                });
 1774
 221775            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 221776                {
 221777                    b.Navigation("BaseItemsMap");
 221778                });
 1779
 221780            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 221781                {
 221782                    b.Navigation("BaseItems");
 221783                });
 1784
 221785            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 221786                {
 221787                    b.Navigation("AccessSchedules");
 221788
 221789                    b.Navigation("DisplayPreferences");
 221790
 221791                    b.Navigation("ItemDisplayPreferences");
 221792
 221793                    b.Navigation("Permissions");
 221794
 221795                    b.Navigation("Preferences");
 221796
 221797                    b.Navigation("ProfileImage");
 221798                });
 1799#pragma warning restore 612, 618
 221800        }
 1801    }
 1802}