< Summary - Jellyfin

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

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

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

Metrics

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

File(s)

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

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace Jellyfin.Database.Providers.Sqlite.Migrations
 6{
 7    /// <inheritdoc />
 8    public partial class AllowDuplicatePlaylistChildren : Migration
 9    {
 10        /// <inheritdoc />
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 13            // Rows that predate the composite (ParentId, SortOrder) primary key stored a null SortOrder
 14            // (e.g. BoxSet and Collection children). Assign each such row a stable 0-based position within
 15            // its parent so the rows stay unique once SortOrder becomes part of the primary key; otherwise
 16            // they would all collapse to the column default (0) and collide during the table rebuild.
 2217            migrationBuilder.Sql(
 2218                @"UPDATE ""LinkedChildren""
 2219                  SET ""SortOrder"" = (
 2220                      SELECT COUNT(*)
 2221                      FROM ""LinkedChildren"" AS lc2
 2222                      WHERE lc2.""ParentId"" = ""LinkedChildren"".""ParentId""
 2223                        AND lc2.""rowid"" < ""LinkedChildren"".""rowid""
 2224                  )
 2225                  WHERE ""SortOrder"" IS NULL;");
 26
 2227            migrationBuilder.DropPrimaryKey(
 2228                name: "PK_LinkedChildren",
 2229                table: "LinkedChildren");
 30
 2231            migrationBuilder.DropIndex(
 2232                name: "IX_LinkedChildren_ParentId_SortOrder",
 2233                table: "LinkedChildren");
 34
 2235            migrationBuilder.AlterColumn<int>(
 2236                name: "SortOrder",
 2237                table: "LinkedChildren",
 2238                type: "INTEGER",
 2239                nullable: false,
 2240                defaultValue: 0,
 2241                oldClrType: typeof(int),
 2242                oldType: "INTEGER",
 2243                oldNullable: true);
 44
 2245            migrationBuilder.AddPrimaryKey(
 2246                name: "PK_LinkedChildren",
 2247                table: "LinkedChildren",
 2248                columns: new[] { "ParentId", "SortOrder" });
 2249        }
 50
 51        /// <inheritdoc />
 52        protected override void Down(MigrationBuilder migrationBuilder)
 53        {
 54            // The (ParentId, ChildId) primary key cannot represent the same child more than once per
 55            // parent. Drop any duplicate entries (keeping the first by SortOrder) that may have been
 56            // created while duplicates were allowed, so the old key can be restored. This is lossy by
 57            // nature — duplicate playlist entries cannot survive a downgrade.
 058            migrationBuilder.Sql(
 059                @"DELETE FROM ""LinkedChildren""
 060                  WHERE ""rowid"" NOT IN (
 061                      SELECT MIN(""rowid"")
 062                      FROM ""LinkedChildren""
 063                      GROUP BY ""ParentId"", ""ChildId""
 064                  );");
 65
 066            migrationBuilder.DropPrimaryKey(
 067                name: "PK_LinkedChildren",
 068                table: "LinkedChildren");
 69
 070            migrationBuilder.AlterColumn<int>(
 071                name: "SortOrder",
 072                table: "LinkedChildren",
 073                type: "INTEGER",
 074                nullable: true,
 075                oldClrType: typeof(int),
 076                oldType: "INTEGER");
 77
 078            migrationBuilder.AddPrimaryKey(
 079                name: "PK_LinkedChildren",
 080                table: "LinkedChildren",
 081                columns: new[] { "ParentId", "ChildId" });
 82
 083            migrationBuilder.CreateIndex(
 084                name: "IX_LinkedChildren_ParentId_SortOrder",
 085                table: "LinkedChildren",
 086                columns: new[] { "ParentId", "SortOrder" });
 087        }
 88    }
 89}

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

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Jellyfin.Database.Implementations;
 4using Microsoft.EntityFrameworkCore;
 5using Microsoft.EntityFrameworkCore.Infrastructure;
 6using Microsoft.EntityFrameworkCore.Migrations;
 7using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 8
 9#nullable disable
 10
 11namespace Jellyfin.Database.Providers.Sqlite.Migrations
 12{
 13    [DbContext(typeof(JellyfinDbContext))]
 14    [Migration("20260723111547_AllowDuplicatePlaylistChildren")]
 15    partial class AllowDuplicatePlaylistChildren
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 2221            modelBuilder.HasAnnotation("ProductVersion", "10.0.10");
 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<int?>("ExtraType")
 22214                        .HasColumnType("INTEGER");
 22215
 22216                    b.Property<string>("ForcedSortName")
 22217                        .HasColumnType("TEXT");
 22218
 22219                    b.Property<string>("Genres")
 22220                        .HasColumnType("TEXT");
 22221
 22222                    b.Property<int?>("Height")
 22223                        .HasColumnType("INTEGER");
 22224
 22225                    b.Property<int?>("IndexNumber")
 22226                        .HasColumnType("INTEGER");
 22227
 22228                    b.Property<int?>("InheritedParentalRatingSubValue")
 22229                        .HasColumnType("INTEGER");
 22230
 22231                    b.Property<int?>("InheritedParentalRatingValue")
 22232                        .HasColumnType("INTEGER");
 22233
 22234                    b.Property<bool>("IsFolder")
 22235                        .HasColumnType("INTEGER");
 22236
 22237                    b.Property<bool>("IsInMixedFolder")
 22238                        .HasColumnType("INTEGER");
 22239
 22240                    b.Property<bool>("IsLocked")
 22241                        .HasColumnType("INTEGER");
 22242
 22243                    b.Property<bool>("IsMovie")
 22244                        .HasColumnType("INTEGER");
 22245
 22246                    b.Property<bool>("IsRepeat")
 22247                        .HasColumnType("INTEGER");
 22248
 22249                    b.Property<bool>("IsSeries")
 22250                        .HasColumnType("INTEGER");
 22251
 22252                    b.Property<bool>("IsVirtualItem")
 22253                        .HasColumnType("INTEGER");
 22254
 22255                    b.Property<float?>("LUFS")
 22256                        .HasColumnType("REAL");
 22257
 22258                    b.Property<string>("MediaType")
 22259                        .HasColumnType("TEXT");
 22260
 22261                    b.Property<string>("Name")
 22262                        .HasColumnType("TEXT");
 22263
 22264                    b.Property<float?>("NormalizationGain")
 22265                        .HasColumnType("REAL");
 22266
 22267                    b.Property<string>("OfficialRating")
 22268                        .HasColumnType("TEXT");
 22269
 22270                    b.Property<string>("OriginalLanguage")
 22271                        .HasColumnType("TEXT");
 22272
 22273                    b.Property<string>("OriginalTitle")
 22274                        .HasColumnType("TEXT");
 22275
 22276                    b.Property<string>("Overview")
 22277                        .HasColumnType("TEXT");
 22278
 22279                    b.Property<Guid?>("OwnerId")
 22280                        .HasColumnType("TEXT");
 22281
 22282                    b.Property<Guid?>("ParentId")
 22283                        .HasColumnType("TEXT");
 22284
 22285                    b.Property<int?>("ParentIndexNumber")
 22286                        .HasColumnType("INTEGER");
 22287
 22288                    b.Property<string>("Path")
 22289                        .HasColumnType("TEXT");
 22290
 22291                    b.Property<string>("PreferredMetadataCountryCode")
 22292                        .HasColumnType("TEXT");
 22293
 22294                    b.Property<string>("PreferredMetadataLanguage")
 22295                        .HasColumnType("TEXT");
 22296
 22297                    b.Property<DateTime?>("PremiereDate")
 22298                        .HasColumnType("TEXT");
 22299
 22300                    b.Property<string>("PresentationUniqueKey")
 22301                        .HasColumnType("TEXT");
 22302
 22303                    b.Property<Guid?>("PrimaryVersionId")
 22304                        .HasColumnType("TEXT");
 22305
 22306                    b.Property<string>("ProductionLocations")
 22307                        .HasColumnType("TEXT");
 22308
 22309                    b.Property<int?>("ProductionYear")
 22310                        .HasColumnType("INTEGER");
 22311
 22312                    b.Property<long?>("RunTimeTicks")
 22313                        .HasColumnType("INTEGER");
 22314
 22315                    b.Property<Guid?>("SeasonId")
 22316                        .HasColumnType("TEXT");
 22317
 22318                    b.Property<string>("SeasonName")
 22319                        .HasColumnType("TEXT");
 22320
 22321                    b.Property<Guid?>("SeriesId")
 22322                        .HasColumnType("TEXT");
 22323
 22324                    b.Property<string>("SeriesName")
 22325                        .HasColumnType("TEXT");
 22326
 22327                    b.Property<string>("SeriesPresentationUniqueKey")
 22328                        .HasColumnType("TEXT");
 22329
 22330                    b.Property<string>("ShowId")
 22331                        .HasColumnType("TEXT");
 22332
 22333                    b.Property<long?>("Size")
 22334                        .HasColumnType("INTEGER");
 22335
 22336                    b.Property<string>("SortName")
 22337                        .HasColumnType("TEXT");
 22338
 22339                    b.Property<DateTime?>("StartDate")
 22340                        .HasColumnType("TEXT");
 22341
 22342                    b.Property<string>("Studios")
 22343                        .HasColumnType("TEXT");
 22344
 22345                    b.Property<string>("Tagline")
 22346                        .HasColumnType("TEXT");
 22347
 22348                    b.Property<string>("Tags")
 22349                        .HasColumnType("TEXT");
 22350
 22351                    b.Property<Guid?>("TopParentId")
 22352                        .HasColumnType("TEXT");
 22353
 22354                    b.Property<int?>("TotalBitrate")
 22355                        .HasColumnType("INTEGER");
 22356
 22357                    b.Property<string>("Type")
 22358                        .IsRequired()
 22359                        .HasColumnType("TEXT");
 22360
 22361                    b.Property<string>("UnratedType")
 22362                        .HasColumnType("TEXT");
 22363
 22364                    b.Property<int?>("Width")
 22365                        .HasColumnType("INTEGER");
 22366
 22367                    b.HasKey("Id");
 22368
 22369                    b.HasIndex("Name");
 22370
 22371                    b.HasIndex("OwnerId");
 22372
 22373                    b.HasIndex("ParentId");
 22374
 22375                    b.HasIndex("Path");
 22376
 22377                    b.HasIndex("PresentationUniqueKey");
 22378
 22379                    b.HasIndex("SeasonId");
 22380
 22381                    b.HasIndex("SeriesId");
 22382
 22383                    b.HasIndex("SeriesName");
 22384
 22385                    b.HasIndex("ExtraType", "OwnerId");
 22386
 22387                    b.HasIndex("TopParentId", "Id");
 22388
 22389                    b.HasIndex("Type", "CleanName");
 22390
 22391                    b.HasIndex("TopParentId", "Type", "IsVirtualItem")
 22392                        .HasFilter("\"PrimaryVersionId\" IS NULL AND (\"OwnerId\" IS NULL OR \"ExtraType\" IS NOT NULL)"
 22393
 22394                    b.HasIndex("Type", "TopParentId", "Id");
 22395
 22396                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 22397
 22398                    b.HasIndex("Type", "TopParentId", "SortName");
 22399
 22400                    b.HasIndex("Type", "TopParentId", "StartDate");
 22401
 22402                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 22403
 22404                    b.HasIndex("TopParentId", "IsFolder", "IsVirtualItem", "DateCreated");
 22405
 22406                    b.HasIndex("TopParentId", "MediaType", "IsVirtualItem", "DateCreated");
 22407
 22408                    b.HasIndex("TopParentId", "Type", "IsVirtualItem", "DateCreated");
 22409
 22410                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 22411
 22412                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "ParentIndexNumber", "IndexNumber");
 22413
 22414                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 22415
 22416                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 22417
 22418                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 22419
 22420                    b.ToTable("BaseItems");
 22421
 22422                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22423
 22424                    b.HasData(
 22425                        new
 22426                        {
 22427                            Id = new Guid("00000000-0000-0000-0000-000000000001"),
 22428                            IsFolder = false,
 22429                            IsInMixedFolder = false,
 22430                            IsLocked = false,
 22431                            IsMovie = false,
 22432                            IsRepeat = false,
 22433                            IsSeries = false,
 22434                            IsVirtualItem = false,
 22435                            Name = "This is a placeholder item for UserData that has been detached from its original ite
 22436                            Type = "PLACEHOLDER"
 22437                        });
 22438                });
 439
 22440            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 22441                {
 22442                    b.Property<Guid>("Id")
 22443                        .ValueGeneratedOnAdd()
 22444                        .HasColumnType("TEXT");
 22445
 22446                    b.Property<byte[]>("Blurhash")
 22447                        .HasColumnType("BLOB");
 22448
 22449                    b.Property<DateTime?>("DateModified")
 22450                        .HasColumnType("TEXT");
 22451
 22452                    b.Property<int>("Height")
 22453                        .HasColumnType("INTEGER");
 22454
 22455                    b.Property<int>("ImageType")
 22456                        .HasColumnType("INTEGER");
 22457
 22458                    b.Property<Guid>("ItemId")
 22459                        .HasColumnType("TEXT");
 22460
 22461                    b.Property<string>("Path")
 22462                        .IsRequired()
 22463                        .HasColumnType("TEXT");
 22464
 22465                    b.Property<int>("Width")
 22466                        .HasColumnType("INTEGER");
 22467
 22468                    b.HasKey("Id");
 22469
 22470                    b.HasIndex("ItemId", "ImageType");
 22471
 22472                    b.ToTable("BaseItemImageInfos");
 22473
 22474                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22475                });
 476
 22477            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 22478                {
 22479                    b.Property<int>("Id")
 22480                        .HasColumnType("INTEGER");
 22481
 22482                    b.Property<Guid>("ItemId")
 22483                        .HasColumnType("TEXT");
 22484
 22485                    b.HasKey("Id", "ItemId");
 22486
 22487                    b.HasIndex("ItemId");
 22488
 22489                    b.ToTable("BaseItemMetadataFields");
 22490
 22491                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22492                });
 493
 22494            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 22495                {
 22496                    b.Property<Guid>("ItemId")
 22497                        .HasColumnType("TEXT");
 22498
 22499                    b.Property<string>("ProviderId")
 22500                        .HasColumnType("TEXT");
 22501
 22502                    b.Property<string>("ProviderValue")
 22503                        .IsRequired()
 22504                        .HasColumnType("TEXT");
 22505
 22506                    b.HasKey("ItemId", "ProviderId");
 22507
 22508                    b.HasIndex("ProviderId", "ItemId", "ProviderValue");
 22509
 22510                    b.ToTable("BaseItemProviders");
 22511
 22512                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22513                });
 514
 22515            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 22516                {
 22517                    b.Property<int>("Id")
 22518                        .HasColumnType("INTEGER");
 22519
 22520                    b.Property<Guid>("ItemId")
 22521                        .HasColumnType("TEXT");
 22522
 22523                    b.HasKey("Id", "ItemId");
 22524
 22525                    b.HasIndex("ItemId");
 22526
 22527                    b.ToTable("BaseItemTrailerTypes");
 22528
 22529                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22530                });
 531
 22532            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 22533                {
 22534                    b.Property<Guid>("ItemId")
 22535                        .HasColumnType("TEXT");
 22536
 22537                    b.Property<int>("ChapterIndex")
 22538                        .HasColumnType("INTEGER");
 22539
 22540                    b.Property<DateTime?>("ImageDateModified")
 22541                        .HasColumnType("TEXT");
 22542
 22543                    b.Property<string>("ImagePath")
 22544                        .HasColumnType("TEXT");
 22545
 22546                    b.Property<string>("Name")
 22547                        .HasColumnType("TEXT");
 22548
 22549                    b.Property<long>("StartPositionTicks")
 22550                        .HasColumnType("INTEGER");
 22551
 22552                    b.HasKey("ItemId", "ChapterIndex");
 22553
 22554                    b.ToTable("Chapters");
 22555
 22556                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22557                });
 558
 22559            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.CustomItemDisplayPreferences", b =>
 22560                {
 22561                    b.Property<int>("Id")
 22562                        .ValueGeneratedOnAdd()
 22563                        .HasColumnType("INTEGER");
 22564
 22565                    b.Property<string>("Client")
 22566                        .IsRequired()
 22567                        .HasMaxLength(32)
 22568                        .HasColumnType("TEXT");
 22569
 22570                    b.Property<Guid>("ItemId")
 22571                        .HasColumnType("TEXT");
 22572
 22573                    b.Property<string>("Key")
 22574                        .IsRequired()
 22575                        .HasColumnType("TEXT");
 22576
 22577                    b.Property<Guid>("UserId")
 22578                        .HasColumnType("TEXT");
 22579
 22580                    b.Property<string>("Value")
 22581                        .HasColumnType("TEXT");
 22582
 22583                    b.HasKey("Id");
 22584
 22585                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 22586                        .IsUnique();
 22587
 22588                    b.ToTable("CustomItemDisplayPreferences");
 22589
 22590                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22591                });
 592
 22593            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 22594                {
 22595                    b.Property<int>("Id")
 22596                        .ValueGeneratedOnAdd()
 22597                        .HasColumnType("INTEGER");
 22598
 22599                    b.Property<int>("ChromecastVersion")
 22600                        .HasColumnType("INTEGER");
 22601
 22602                    b.Property<string>("Client")
 22603                        .IsRequired()
 22604                        .HasMaxLength(32)
 22605                        .HasColumnType("TEXT");
 22606
 22607                    b.Property<string>("DashboardTheme")
 22608                        .HasMaxLength(32)
 22609                        .HasColumnType("TEXT");
 22610
 22611                    b.Property<bool>("EnableNextVideoInfoOverlay")
 22612                        .HasColumnType("INTEGER");
 22613
 22614                    b.Property<int?>("IndexBy")
 22615                        .HasColumnType("INTEGER");
 22616
 22617                    b.Property<Guid>("ItemId")
 22618                        .HasColumnType("TEXT");
 22619
 22620                    b.Property<int>("ScrollDirection")
 22621                        .HasColumnType("INTEGER");
 22622
 22623                    b.Property<bool>("ShowBackdrop")
 22624                        .HasColumnType("INTEGER");
 22625
 22626                    b.Property<bool>("ShowSidebar")
 22627                        .HasColumnType("INTEGER");
 22628
 22629                    b.Property<int>("SkipBackwardLength")
 22630                        .HasColumnType("INTEGER");
 22631
 22632                    b.Property<int>("SkipForwardLength")
 22633                        .HasColumnType("INTEGER");
 22634
 22635                    b.Property<string>("TvHome")
 22636                        .HasMaxLength(32)
 22637                        .HasColumnType("TEXT");
 22638
 22639                    b.Property<Guid>("UserId")
 22640                        .HasColumnType("TEXT");
 22641
 22642                    b.HasKey("Id");
 22643
 22644                    b.HasIndex("UserId", "ItemId", "Client")
 22645                        .IsUnique();
 22646
 22647                    b.ToTable("DisplayPreferences");
 22648
 22649                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22650                });
 651
 22652            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 22653                {
 22654                    b.Property<int>("Id")
 22655                        .ValueGeneratedOnAdd()
 22656                        .HasColumnType("INTEGER");
 22657
 22658                    b.Property<int>("DisplayPreferencesId")
 22659                        .HasColumnType("INTEGER");
 22660
 22661                    b.Property<int>("Order")
 22662                        .HasColumnType("INTEGER");
 22663
 22664                    b.Property<int>("Type")
 22665                        .HasColumnType("INTEGER");
 22666
 22667                    b.HasKey("Id");
 22668
 22669                    b.HasIndex("DisplayPreferencesId");
 22670
 22671                    b.ToTable("HomeSection");
 22672
 22673                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22674                });
 675
 22676            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 22677                {
 22678                    b.Property<int>("Id")
 22679                        .ValueGeneratedOnAdd()
 22680                        .HasColumnType("INTEGER");
 22681
 22682                    b.Property<DateTime>("LastModified")
 22683                        .HasColumnType("TEXT");
 22684
 22685                    b.Property<string>("Path")
 22686                        .IsRequired()
 22687                        .HasMaxLength(512)
 22688                        .HasColumnType("TEXT");
 22689
 22690                    b.Property<Guid?>("UserId")
 22691                        .HasColumnType("TEXT");
 22692
 22693                    b.HasKey("Id");
 22694
 22695                    b.HasIndex("UserId")
 22696                        .IsUnique();
 22697
 22698                    b.ToTable("ImageInfos");
 22699
 22700                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22701                });
 702
 22703            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 22704                {
 22705                    b.Property<int>("Id")
 22706                        .ValueGeneratedOnAdd()
 22707                        .HasColumnType("INTEGER");
 22708
 22709                    b.Property<string>("Client")
 22710                        .IsRequired()
 22711                        .HasMaxLength(32)
 22712                        .HasColumnType("TEXT");
 22713
 22714                    b.Property<int?>("IndexBy")
 22715                        .HasColumnType("INTEGER");
 22716
 22717                    b.Property<Guid>("ItemId")
 22718                        .HasColumnType("TEXT");
 22719
 22720                    b.Property<bool>("RememberIndexing")
 22721                        .HasColumnType("INTEGER");
 22722
 22723                    b.Property<bool>("RememberSorting")
 22724                        .HasColumnType("INTEGER");
 22725
 22726                    b.Property<string>("SortBy")
 22727                        .IsRequired()
 22728                        .HasMaxLength(64)
 22729                        .HasColumnType("TEXT");
 22730
 22731                    b.Property<int>("SortOrder")
 22732                        .HasColumnType("INTEGER");
 22733
 22734                    b.Property<Guid>("UserId")
 22735                        .HasColumnType("TEXT");
 22736
 22737                    b.Property<int>("ViewType")
 22738                        .HasColumnType("INTEGER");
 22739
 22740                    b.HasKey("Id");
 22741
 22742                    b.HasIndex("UserId");
 22743
 22744                    b.ToTable("ItemDisplayPreferences");
 22745
 22746                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22747                });
 748
 22749            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 22750                {
 22751                    b.Property<Guid>("ItemValueId")
 22752                        .ValueGeneratedOnAdd()
 22753                        .HasColumnType("TEXT");
 22754
 22755                    b.Property<string>("CleanValue")
 22756                        .IsRequired()
 22757                        .HasColumnType("TEXT");
 22758
 22759                    b.Property<int>("Type")
 22760                        .HasColumnType("INTEGER");
 22761
 22762                    b.Property<string>("Value")
 22763                        .IsRequired()
 22764                        .HasColumnType("TEXT");
 22765
 22766                    b.HasKey("ItemValueId");
 22767
 22768                    b.HasIndex("Type", "CleanValue");
 22769
 22770                    b.HasIndex("Type", "Value")
 22771                        .IsUnique();
 22772
 22773                    b.ToTable("ItemValues");
 22774
 22775                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22776                });
 777
 22778            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 22779                {
 22780                    b.Property<Guid>("ItemValueId")
 22781                        .HasColumnType("TEXT");
 22782
 22783                    b.Property<Guid>("ItemId")
 22784                        .HasColumnType("TEXT");
 22785
 22786                    b.HasKey("ItemValueId", "ItemId");
 22787
 22788                    b.HasIndex("ItemId");
 22789
 22790                    b.ToTable("ItemValuesMap");
 22791
 22792                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22793                });
 794
 22795            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 22796                {
 22797                    b.Property<Guid>("ItemId")
 22798                        .HasColumnType("TEXT");
 22799
 22800                    b.PrimitiveCollection<string>("KeyframeTicks")
 22801                        .HasColumnType("TEXT");
 22802
 22803                    b.Property<long>("TotalDuration")
 22804                        .HasColumnType("INTEGER");
 22805
 22806                    b.HasKey("ItemId");
 22807
 22808                    b.ToTable("KeyframeData");
 22809
 22810                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22811                });
 812
 22813            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 22814                {
 22815                    b.Property<Guid>("ParentId")
 22816                        .HasColumnType("TEXT");
 22817
 22818                    b.Property<int>("SortOrder")
 22819                        .HasColumnType("INTEGER");
 22820
 22821                    b.Property<Guid>("ChildId")
 22822                        .HasColumnType("TEXT");
 22823
 22824                    b.Property<int>("ChildType")
 22825                        .HasColumnType("INTEGER");
 22826
 22827                    b.HasKey("ParentId", "SortOrder");
 22828
 22829                    b.HasIndex("ChildId", "ChildType");
 22830
 22831                    b.HasIndex("ParentId", "ChildType");
 22832
 22833                    b.ToTable("LinkedChildren", (string)null);
 22834
 22835                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22836                });
 837
 22838            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaSegment", b =>
 22839                {
 22840                    b.Property<Guid>("Id")
 22841                        .ValueGeneratedOnAdd()
 22842                        .HasColumnType("TEXT");
 22843
 22844                    b.Property<long>("EndTicks")
 22845                        .HasColumnType("INTEGER");
 22846
 22847                    b.Property<Guid>("ItemId")
 22848                        .HasColumnType("TEXT");
 22849
 22850                    b.Property<string>("SegmentProviderId")
 22851                        .IsRequired()
 22852                        .HasColumnType("TEXT");
 22853
 22854                    b.Property<long>("StartTicks")
 22855                        .HasColumnType("INTEGER");
 22856
 22857                    b.Property<int>("Type")
 22858                        .HasColumnType("INTEGER");
 22859
 22860                    b.HasKey("Id");
 22861
 22862                    b.ToTable("MediaSegments");
 22863
 22864                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 22865                });
 866
 22867            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 22868                {
 22869                    b.Property<Guid>("ItemId")
 22870                        .HasColumnType("TEXT");
 22871
 22872                    b.Property<int>("StreamIndex")
 22873                        .HasColumnType("INTEGER");
 22874
 22875                    b.Property<string>("AspectRatio")
 22876                        .HasColumnType("TEXT");
 22877
 22878                    b.Property<float?>("AverageFrameRate")
 22879                        .HasColumnType("REAL");
 22880
 22881                    b.Property<int?>("BitDepth")
 22882                        .HasColumnType("INTEGER");
 22883
 22884                    b.Property<int?>("BitRate")
 22885                        .HasColumnType("INTEGER");
 22886
 22887                    b.Property<int?>("BlPresentFlag")
 22888                        .HasColumnType("INTEGER");
 22889
 22890                    b.Property<string>("ChannelLayout")
 22891                        .HasColumnType("TEXT");
 22892
 22893                    b.Property<int?>("Channels")
 22894                        .HasColumnType("INTEGER");
 22895
 22896                    b.Property<string>("Codec")
 22897                        .HasColumnType("TEXT");
 22898
 22899                    b.Property<string>("CodecTag")
 22900                        .HasColumnType("TEXT");
 22901
 22902                    b.Property<string>("CodecTimeBase")
 22903                        .HasColumnType("TEXT");
 22904
 22905                    b.Property<string>("ColorPrimaries")
 22906                        .HasColumnType("TEXT");
 22907
 22908                    b.Property<string>("ColorSpace")
 22909                        .HasColumnType("TEXT");
 22910
 22911                    b.Property<string>("ColorTransfer")
 22912                        .HasColumnType("TEXT");
 22913
 22914                    b.Property<string>("Comment")
 22915                        .HasColumnType("TEXT");
 22916
 22917                    b.Property<int?>("DvBlSignalCompatibilityId")
 22918                        .HasColumnType("INTEGER");
 22919
 22920                    b.Property<int?>("DvLevel")
 22921                        .HasColumnType("INTEGER");
 22922
 22923                    b.Property<int?>("DvProfile")
 22924                        .HasColumnType("INTEGER");
 22925
 22926                    b.Property<int?>("DvVersionMajor")
 22927                        .HasColumnType("INTEGER");
 22928
 22929                    b.Property<int?>("DvVersionMinor")
 22930                        .HasColumnType("INTEGER");
 22931
 22932                    b.Property<int?>("ElPresentFlag")
 22933                        .HasColumnType("INTEGER");
 22934
 22935                    b.Property<bool?>("Hdr10PlusPresentFlag")
 22936                        .HasColumnType("INTEGER");
 22937
 22938                    b.Property<int?>("Height")
 22939                        .HasColumnType("INTEGER");
 22940
 22941                    b.Property<bool?>("IsAnamorphic")
 22942                        .HasColumnType("INTEGER");
 22943
 22944                    b.Property<bool?>("IsAvc")
 22945                        .HasColumnType("INTEGER");
 22946
 22947                    b.Property<bool>("IsDefault")
 22948                        .HasColumnType("INTEGER");
 22949
 22950                    b.Property<bool>("IsExternal")
 22951                        .HasColumnType("INTEGER");
 22952
 22953                    b.Property<bool>("IsForced")
 22954                        .HasColumnType("INTEGER");
 22955
 22956                    b.Property<bool?>("IsHearingImpaired")
 22957                        .HasColumnType("INTEGER");
 22958
 22959                    b.Property<bool?>("IsInterlaced")
 22960                        .HasColumnType("INTEGER");
 22961
 22962                    b.Property<bool>("IsOriginal")
 22963                        .HasColumnType("INTEGER");
 22964
 22965                    b.Property<string>("KeyFrames")
 22966                        .HasColumnType("TEXT");
 22967
 22968                    b.Property<string>("Language")
 22969                        .HasColumnType("TEXT");
 22970
 22971                    b.Property<float?>("Level")
 22972                        .HasColumnType("REAL");
 22973
 22974                    b.Property<string>("NalLengthSize")
 22975                        .HasColumnType("TEXT");
 22976
 22977                    b.Property<string>("Path")
 22978                        .HasColumnType("TEXT");
 22979
 22980                    b.Property<string>("PixelFormat")
 22981                        .HasColumnType("TEXT");
 22982
 22983                    b.Property<string>("Profile")
 22984                        .HasColumnType("TEXT");
 22985
 22986                    b.Property<float?>("RealFrameRate")
 22987                        .HasColumnType("REAL");
 22988
 22989                    b.Property<int?>("RefFrames")
 22990                        .HasColumnType("INTEGER");
 22991
 22992                    b.Property<int?>("Rotation")
 22993                        .HasColumnType("INTEGER");
 22994
 22995                    b.Property<int?>("RpuPresentFlag")
 22996                        .HasColumnType("INTEGER");
 22997
 22998                    b.Property<int?>("SampleRate")
 22999                        .HasColumnType("INTEGER");
 221000
 221001                    b.Property<int>("StreamType")
 221002                        .HasColumnType("INTEGER");
 221003
 221004                    b.Property<string>("TimeBase")
 221005                        .HasColumnType("TEXT");
 221006
 221007                    b.Property<string>("Title")
 221008                        .HasColumnType("TEXT");
 221009
 221010                    b.Property<int?>("Width")
 221011                        .HasColumnType("INTEGER");
 221012
 221013                    b.HasKey("ItemId", "StreamIndex");
 221014
 221015                    b.ToTable("MediaStreamInfos");
 221016
 221017                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221018                });
 1019
 221020            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 221021                {
 221022                    b.Property<Guid>("Id")
 221023                        .ValueGeneratedOnAdd()
 221024                        .HasColumnType("TEXT");
 221025
 221026                    b.Property<string>("Name")
 221027                        .IsRequired()
 221028                        .HasColumnType("TEXT");
 221029
 221030                    b.Property<string>("PersonType")
 221031                        .HasColumnType("TEXT");
 221032
 221033                    b.HasKey("Id");
 221034
 221035                    b.HasIndex("Name");
 221036
 221037                    b.ToTable("Peoples");
 221038
 221039                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221040                });
 1041
 221042            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 221043                {
 221044                    b.Property<Guid>("ItemId")
 221045                        .HasColumnType("TEXT");
 221046
 221047                    b.Property<Guid>("PeopleId")
 221048                        .HasColumnType("TEXT");
 221049
 221050                    b.Property<string>("Role")
 221051                        .HasColumnType("TEXT");
 221052
 221053                    b.Property<int?>("ListOrder")
 221054                        .HasColumnType("INTEGER");
 221055
 221056                    b.Property<int?>("SortOrder")
 221057                        .HasColumnType("INTEGER");
 221058
 221059                    b.HasKey("ItemId", "PeopleId", "Role");
 221060
 221061                    b.HasIndex("PeopleId");
 221062
 221063                    b.HasIndex("ItemId", "ListOrder");
 221064
 221065                    b.HasIndex("ItemId", "SortOrder");
 221066
 221067                    b.ToTable("PeopleBaseItemMap");
 221068
 221069                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221070                });
 1071
 221072            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 221073                {
 221074                    b.Property<int>("Id")
 221075                        .ValueGeneratedOnAdd()
 221076                        .HasColumnType("INTEGER");
 221077
 221078                    b.Property<int>("Kind")
 221079                        .HasColumnType("INTEGER");
 221080
 221081                    b.Property<Guid?>("Permission_Permissions_Guid")
 221082                        .HasColumnType("TEXT");
 221083
 221084                    b.Property<uint>("RowVersion")
 221085                        .IsConcurrencyToken()
 221086                        .HasColumnType("INTEGER");
 221087
 221088                    b.Property<Guid?>("UserId")
 221089                        .HasColumnType("TEXT");
 221090
 221091                    b.Property<bool>("Value")
 221092                        .HasColumnType("INTEGER");
 221093
 221094                    b.HasKey("Id");
 221095
 221096                    b.HasIndex("UserId", "Kind")
 221097                        .IsUnique()
 221098                        .HasFilter("[UserId] IS NOT NULL");
 221099
 221100                    b.ToTable("Permissions");
 221101
 221102                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221103                });
 1104
 221105            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 221106                {
 221107                    b.Property<int>("Id")
 221108                        .ValueGeneratedOnAdd()
 221109                        .HasColumnType("INTEGER");
 221110
 221111                    b.Property<int>("Kind")
 221112                        .HasColumnType("INTEGER");
 221113
 221114                    b.Property<Guid?>("Preference_Preferences_Guid")
 221115                        .HasColumnType("TEXT");
 221116
 221117                    b.Property<uint>("RowVersion")
 221118                        .IsConcurrencyToken()
 221119                        .HasColumnType("INTEGER");
 221120
 221121                    b.Property<Guid?>("UserId")
 221122                        .HasColumnType("TEXT");
 221123
 221124                    b.Property<string>("Value")
 221125                        .IsRequired()
 221126                        .HasMaxLength(65535)
 221127                        .HasColumnType("TEXT");
 221128
 221129                    b.HasKey("Id");
 221130
 221131                    b.HasIndex("UserId", "Kind")
 221132                        .IsUnique()
 221133                        .HasFilter("[UserId] IS NOT NULL");
 221134
 221135                    b.ToTable("Preferences");
 221136
 221137                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221138                });
 1139
 221140            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.ApiKey", b =>
 221141                {
 221142                    b.Property<int>("Id")
 221143                        .ValueGeneratedOnAdd()
 221144                        .HasColumnType("INTEGER");
 221145
 221146                    b.Property<string>("AccessToken")
 221147                        .IsRequired()
 221148                        .HasColumnType("TEXT");
 221149
 221150                    b.Property<DateTime>("DateCreated")
 221151                        .HasColumnType("TEXT");
 221152
 221153                    b.Property<DateTime>("DateLastActivity")
 221154                        .HasColumnType("TEXT");
 221155
 221156                    b.Property<string>("Name")
 221157                        .IsRequired()
 221158                        .HasMaxLength(64)
 221159                        .HasColumnType("TEXT");
 221160
 221161                    b.HasKey("Id");
 221162
 221163                    b.HasIndex("AccessToken")
 221164                        .IsUnique();
 221165
 221166                    b.ToTable("ApiKeys");
 221167
 221168                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221169                });
 1170
 221171            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 221172                {
 221173                    b.Property<int>("Id")
 221174                        .ValueGeneratedOnAdd()
 221175                        .HasColumnType("INTEGER");
 221176
 221177                    b.Property<string>("AccessToken")
 221178                        .IsRequired()
 221179                        .HasColumnType("TEXT");
 221180
 221181                    b.Property<string>("AppName")
 221182                        .IsRequired()
 221183                        .HasMaxLength(64)
 221184                        .HasColumnType("TEXT");
 221185
 221186                    b.Property<string>("AppVersion")
 221187                        .IsRequired()
 221188                        .HasMaxLength(32)
 221189                        .HasColumnType("TEXT");
 221190
 221191                    b.Property<DateTime>("DateCreated")
 221192                        .HasColumnType("TEXT");
 221193
 221194                    b.Property<DateTime>("DateLastActivity")
 221195                        .HasColumnType("TEXT");
 221196
 221197                    b.Property<DateTime>("DateModified")
 221198                        .HasColumnType("TEXT");
 221199
 221200                    b.Property<string>("DeviceId")
 221201                        .IsRequired()
 221202                        .HasMaxLength(256)
 221203                        .HasColumnType("TEXT");
 221204
 221205                    b.Property<string>("DeviceName")
 221206                        .IsRequired()
 221207                        .HasMaxLength(64)
 221208                        .HasColumnType("TEXT");
 221209
 221210                    b.Property<bool>("IsActive")
 221211                        .HasColumnType("INTEGER");
 221212
 221213                    b.Property<Guid>("UserId")
 221214                        .HasColumnType("TEXT");
 221215
 221216                    b.HasKey("Id");
 221217
 221218                    b.HasIndex("AccessToken", "DateLastActivity");
 221219
 221220                    b.HasIndex("DeviceId", "DateLastActivity");
 221221
 221222                    b.HasIndex("UserId", "DeviceId");
 221223
 221224                    b.ToTable("Devices");
 221225
 221226                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221227                });
 1228
 221229            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.DeviceOptions", b =>
 221230                {
 221231                    b.Property<int>("Id")
 221232                        .ValueGeneratedOnAdd()
 221233                        .HasColumnType("INTEGER");
 221234
 221235                    b.Property<string>("CustomName")
 221236                        .HasColumnType("TEXT");
 221237
 221238                    b.Property<string>("DeviceId")
 221239                        .IsRequired()
 221240                        .HasColumnType("TEXT");
 221241
 221242                    b.HasKey("Id");
 221243
 221244                    b.HasIndex("DeviceId")
 221245                        .IsUnique();
 221246
 221247                    b.ToTable("DeviceOptions");
 221248
 221249                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221250                });
 1251
 221252            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.TrickplayInfo", b =>
 221253                {
 221254                    b.Property<Guid>("ItemId")
 221255                        .HasColumnType("TEXT");
 221256
 221257                    b.Property<int>("Width")
 221258                        .HasColumnType("INTEGER");
 221259
 221260                    b.Property<int>("Bandwidth")
 221261                        .HasColumnType("INTEGER");
 221262
 221263                    b.Property<int>("Height")
 221264                        .HasColumnType("INTEGER");
 221265
 221266                    b.Property<int>("Interval")
 221267                        .HasColumnType("INTEGER");
 221268
 221269                    b.Property<int>("ThumbnailCount")
 221270                        .HasColumnType("INTEGER");
 221271
 221272                    b.Property<int>("TileHeight")
 221273                        .HasColumnType("INTEGER");
 221274
 221275                    b.Property<int>("TileWidth")
 221276                        .HasColumnType("INTEGER");
 221277
 221278                    b.HasKey("ItemId", "Width");
 221279
 221280                    b.ToTable("TrickplayInfos");
 221281
 221282                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221283                });
 1284
 221285            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 221286                {
 221287                    b.Property<Guid>("Id")
 221288                        .ValueGeneratedOnAdd()
 221289                        .HasColumnType("TEXT");
 221290
 221291                    b.Property<string>("AudioLanguagePreference")
 221292                        .HasMaxLength(255)
 221293                        .HasColumnType("TEXT");
 221294
 221295                    b.Property<string>("AuthenticationProviderId")
 221296                        .IsRequired()
 221297                        .HasMaxLength(255)
 221298                        .HasColumnType("TEXT");
 221299
 221300                    b.Property<string>("CastReceiverId")
 221301                        .HasMaxLength(32)
 221302                        .HasColumnType("TEXT");
 221303
 221304                    b.Property<bool>("DisplayCollectionsView")
 221305                        .HasColumnType("INTEGER");
 221306
 221307                    b.Property<bool>("DisplayMissingEpisodes")
 221308                        .HasColumnType("INTEGER");
 221309
 221310                    b.Property<bool>("EnableAutoLogin")
 221311                        .HasColumnType("INTEGER");
 221312
 221313                    b.Property<bool>("EnableLocalPassword")
 221314                        .HasColumnType("INTEGER");
 221315
 221316                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 221317                        .HasColumnType("INTEGER");
 221318
 221319                    b.Property<bool>("EnableUserPreferenceAccess")
 221320                        .HasColumnType("INTEGER");
 221321
 221322                    b.Property<bool>("HidePlayedInLatest")
 221323                        .HasColumnType("INTEGER");
 221324
 221325                    b.Property<long>("InternalId")
 221326                        .HasColumnType("INTEGER");
 221327
 221328                    b.Property<int>("InvalidLoginAttemptCount")
 221329                        .HasColumnType("INTEGER");
 221330
 221331                    b.Property<DateTime?>("LastActivityDate")
 221332                        .HasColumnType("TEXT");
 221333
 221334                    b.Property<DateTime?>("LastLoginDate")
 221335                        .HasColumnType("TEXT");
 221336
 221337                    b.Property<int?>("LoginAttemptsBeforeLockout")
 221338                        .HasColumnType("INTEGER");
 221339
 221340                    b.Property<int>("MaxActiveSessions")
 221341                        .HasColumnType("INTEGER");
 221342
 221343                    b.Property<int?>("MaxParentalRatingScore")
 221344                        .HasColumnType("INTEGER");
 221345
 221346                    b.Property<int?>("MaxParentalRatingSubScore")
 221347                        .HasColumnType("INTEGER");
 221348
 221349                    b.Property<bool>("MustUpdatePassword")
 221350                        .HasColumnType("INTEGER");
 221351
 221352                    b.Property<string>("NormalizedUsername")
 221353                        .IsRequired()
 221354                        .HasMaxLength(255)
 221355                        .HasColumnType("TEXT");
 221356
 221357                    b.Property<string>("Password")
 221358                        .HasMaxLength(65535)
 221359                        .HasColumnType("TEXT");
 221360
 221361                    b.Property<string>("PasswordResetProviderId")
 221362                        .IsRequired()
 221363                        .HasMaxLength(255)
 221364                        .HasColumnType("TEXT");
 221365
 221366                    b.Property<bool>("PlayDefaultAudioTrack")
 221367                        .HasColumnType("INTEGER");
 221368
 221369                    b.Property<bool>("RememberAudioSelections")
 221370                        .HasColumnType("INTEGER");
 221371
 221372                    b.Property<bool>("RememberSubtitleSelections")
 221373                        .HasColumnType("INTEGER");
 221374
 221375                    b.Property<int?>("RemoteClientBitrateLimit")
 221376                        .HasColumnType("INTEGER");
 221377
 221378                    b.Property<uint>("RowVersion")
 221379                        .IsConcurrencyToken()
 221380                        .HasColumnType("INTEGER");
 221381
 221382                    b.Property<string>("SubtitleLanguagePreference")
 221383                        .HasMaxLength(255)
 221384                        .HasColumnType("TEXT");
 221385
 221386                    b.Property<int>("SubtitleMode")
 221387                        .HasColumnType("INTEGER");
 221388
 221389                    b.Property<int>("SyncPlayAccess")
 221390                        .HasColumnType("INTEGER");
 221391
 221392                    b.Property<string>("Username")
 221393                        .IsRequired()
 221394                        .HasMaxLength(255)
 221395                        .HasColumnType("TEXT");
 221396
 221397                    b.HasKey("Id");
 221398
 221399                    b.HasIndex("NormalizedUsername")
 221400                        .IsUnique();
 221401
 221402                    b.HasIndex("Username")
 221403                        .IsUnique();
 221404
 221405                    b.ToTable("Users");
 221406
 221407                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221408                });
 1409
 221410            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 221411                {
 221412                    b.Property<Guid>("ItemId")
 221413                        .HasColumnType("TEXT");
 221414
 221415                    b.Property<Guid>("UserId")
 221416                        .HasColumnType("TEXT");
 221417
 221418                    b.Property<string>("CustomDataKey")
 221419                        .HasColumnType("TEXT");
 221420
 221421                    b.Property<int?>("AudioStreamIndex")
 221422                        .HasColumnType("INTEGER");
 221423
 221424                    b.Property<bool>("IsFavorite")
 221425                        .HasColumnType("INTEGER");
 221426
 221427                    b.Property<DateTime?>("LastPlayedDate")
 221428                        .HasColumnType("TEXT");
 221429
 221430                    b.Property<bool?>("Likes")
 221431                        .HasColumnType("INTEGER");
 221432
 221433                    b.Property<int>("PlayCount")
 221434                        .HasColumnType("INTEGER");
 221435
 221436                    b.Property<long>("PlaybackPositionTicks")
 221437                        .HasColumnType("INTEGER");
 221438
 221439                    b.Property<bool>("Played")
 221440                        .HasColumnType("INTEGER");
 221441
 221442                    b.Property<double?>("Rating")
 221443                        .HasColumnType("REAL");
 221444
 221445                    b.Property<DateTime?>("RetentionDate")
 221446                        .HasColumnType("TEXT");
 221447
 221448                    b.Property<int?>("SubtitleStreamIndex")
 221449                        .HasColumnType("INTEGER");
 221450
 221451                    b.HasKey("ItemId", "UserId", "CustomDataKey");
 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.HasIndex("UserId", "IsFavorite", "ItemId");
 221462
 221463                    b.HasIndex("UserId", "ItemId", "LastPlayedDate");
 221464
 221465                    b.HasIndex("UserId", "Played", "ItemId");
 221466
 221467                    b.ToTable("UserData");
 221468
 221469                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 221470                });
 1471
 221472            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 221473                {
 221474                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221475                        .WithMany("AccessSchedules")
 221476                        .HasForeignKey("UserId")
 221477                        .OnDelete(DeleteBehavior.Cascade)
 221478                        .IsRequired();
 221479                });
 1480
 221481            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 221482                {
 221483                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221484                        .WithMany("Parents")
 221485                        .HasForeignKey("ItemId")
 221486                        .OnDelete(DeleteBehavior.Cascade)
 221487                        .IsRequired();
 221488
 221489                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "ParentItem")
 221490                        .WithMany("Children")
 221491                        .HasForeignKey("ParentItemId")
 221492                        .OnDelete(DeleteBehavior.Cascade)
 221493                        .IsRequired();
 221494
 221495                    b.Navigation("Item");
 221496
 221497                    b.Navigation("ParentItem");
 221498                });
 1499
 221500            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 221501                {
 221502                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221503                        .WithMany()
 221504                        .HasForeignKey("ItemId")
 221505                        .OnDelete(DeleteBehavior.Cascade)
 221506                        .IsRequired();
 221507
 221508                    b.Navigation("Item");
 221509                });
 1510
 221511            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 221512                {
 221513                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Owner")
 221514                        .WithMany("Extras")
 221515                        .HasForeignKey("OwnerId")
 221516                        .OnDelete(DeleteBehavior.NoAction);
 221517
 221518                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "DirectParent")
 221519                        .WithMany("DirectChildren")
 221520                        .HasForeignKey("ParentId")
 221521                        .OnDelete(DeleteBehavior.Cascade);
 221522
 221523                    b.Navigation("DirectParent");
 221524
 221525                    b.Navigation("Owner");
 221526                });
 1527
 221528            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 221529                {
 221530                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221531                        .WithMany("Images")
 221532                        .HasForeignKey("ItemId")
 221533                        .OnDelete(DeleteBehavior.Cascade)
 221534                        .IsRequired();
 221535
 221536                    b.Navigation("Item");
 221537                });
 1538
 221539            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 221540                {
 221541                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221542                        .WithMany("LockedFields")
 221543                        .HasForeignKey("ItemId")
 221544                        .OnDelete(DeleteBehavior.Cascade)
 221545                        .IsRequired();
 221546
 221547                    b.Navigation("Item");
 221548                });
 1549
 221550            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 221551                {
 221552                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221553                        .WithMany("Provider")
 221554                        .HasForeignKey("ItemId")
 221555                        .OnDelete(DeleteBehavior.Cascade)
 221556                        .IsRequired();
 221557
 221558                    b.Navigation("Item");
 221559                });
 1560
 221561            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 221562                {
 221563                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221564                        .WithMany("TrailerTypes")
 221565                        .HasForeignKey("ItemId")
 221566                        .OnDelete(DeleteBehavior.Cascade)
 221567                        .IsRequired();
 221568
 221569                    b.Navigation("Item");
 221570                });
 1571
 221572            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 221573                {
 221574                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221575                        .WithMany("Chapters")
 221576                        .HasForeignKey("ItemId")
 221577                        .OnDelete(DeleteBehavior.Cascade)
 221578                        .IsRequired();
 221579
 221580                    b.Navigation("Item");
 221581                });
 1582
 221583            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 221584                {
 221585                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221586                        .WithMany("DisplayPreferences")
 221587                        .HasForeignKey("UserId")
 221588                        .OnDelete(DeleteBehavior.Cascade)
 221589                        .IsRequired();
 221590                });
 1591
 221592            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 221593                {
 221594                    b.HasOne("Jellyfin.Database.Implementations.Entities.DisplayPreferences", null)
 221595                        .WithMany("HomeSections")
 221596                        .HasForeignKey("DisplayPreferencesId")
 221597                        .OnDelete(DeleteBehavior.Cascade)
 221598                        .IsRequired();
 221599                });
 1600
 221601            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 221602                {
 221603                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221604                        .WithOne("ProfileImage")
 221605                        .HasForeignKey("Jellyfin.Database.Implementations.Entities.ImageInfo", "UserId")
 221606                        .OnDelete(DeleteBehavior.Cascade);
 221607                });
 1608
 221609            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 221610                {
 221611                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221612                        .WithMany("ItemDisplayPreferences")
 221613                        .HasForeignKey("UserId")
 221614                        .OnDelete(DeleteBehavior.Cascade)
 221615                        .IsRequired();
 221616                });
 1617
 221618            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 221619                {
 221620                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221621                        .WithMany("ItemValues")
 221622                        .HasForeignKey("ItemId")
 221623                        .OnDelete(DeleteBehavior.Cascade)
 221624                        .IsRequired();
 221625
 221626                    b.HasOne("Jellyfin.Database.Implementations.Entities.ItemValue", "ItemValue")
 221627                        .WithMany("BaseItemsMap")
 221628                        .HasForeignKey("ItemValueId")
 221629                        .OnDelete(DeleteBehavior.Cascade)
 221630                        .IsRequired();
 221631
 221632                    b.Navigation("Item");
 221633
 221634                    b.Navigation("ItemValue");
 221635                });
 1636
 221637            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 221638                {
 221639                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221640                        .WithMany()
 221641                        .HasForeignKey("ItemId")
 221642                        .OnDelete(DeleteBehavior.Cascade)
 221643                        .IsRequired();
 221644
 221645                    b.Navigation("Item");
 221646                });
 1647
 221648            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 221649                {
 221650                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Child")
 221651                        .WithMany("LinkedChildOfEntities")
 221652                        .HasForeignKey("ChildId")
 221653                        .OnDelete(DeleteBehavior.NoAction)
 221654                        .IsRequired();
 221655
 221656                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Parent")
 221657                        .WithMany("LinkedChildEntities")
 221658                        .HasForeignKey("ParentId")
 221659                        .OnDelete(DeleteBehavior.NoAction)
 221660                        .IsRequired();
 221661
 221662                    b.Navigation("Child");
 221663
 221664                    b.Navigation("Parent");
 221665                });
 1666
 221667            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 221668                {
 221669                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221670                        .WithMany("MediaStreams")
 221671                        .HasForeignKey("ItemId")
 221672                        .OnDelete(DeleteBehavior.Cascade)
 221673                        .IsRequired();
 221674
 221675                    b.Navigation("Item");
 221676                });
 1677
 221678            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 221679                {
 221680                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221681                        .WithMany("Peoples")
 221682                        .HasForeignKey("ItemId")
 221683                        .OnDelete(DeleteBehavior.Cascade)
 221684                        .IsRequired();
 221685
 221686                    b.HasOne("Jellyfin.Database.Implementations.Entities.People", "People")
 221687                        .WithMany("BaseItems")
 221688                        .HasForeignKey("PeopleId")
 221689                        .OnDelete(DeleteBehavior.Cascade)
 221690                        .IsRequired();
 221691
 221692                    b.Navigation("Item");
 221693
 221694                    b.Navigation("People");
 221695                });
 1696
 221697            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 221698                {
 221699                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221700                        .WithMany("Permissions")
 221701                        .HasForeignKey("UserId")
 221702                        .OnDelete(DeleteBehavior.Cascade);
 221703                });
 1704
 221705            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 221706                {
 221707                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 221708                        .WithMany("Preferences")
 221709                        .HasForeignKey("UserId")
 221710                        .OnDelete(DeleteBehavior.Cascade);
 221711                });
 1712
 221713            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 221714                {
 221715                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 221716                        .WithMany()
 221717                        .HasForeignKey("UserId")
 221718                        .OnDelete(DeleteBehavior.Cascade)
 221719                        .IsRequired();
 221720
 221721                    b.Navigation("User");
 221722                });
 1723
 221724            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 221725                {
 221726                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 221727                        .WithMany("UserData")
 221728                        .HasForeignKey("ItemId")
 221729                        .OnDelete(DeleteBehavior.Cascade)
 221730                        .IsRequired();
 221731
 221732                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 221733                        .WithMany()
 221734                        .HasForeignKey("UserId")
 221735                        .OnDelete(DeleteBehavior.Cascade)
 221736                        .IsRequired();
 221737
 221738                    b.Navigation("Item");
 221739
 221740                    b.Navigation("User");
 221741                });
 1742
 221743            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 221744                {
 221745                    b.Navigation("Chapters");
 221746
 221747                    b.Navigation("Children");
 221748
 221749                    b.Navigation("DirectChildren");
 221750
 221751                    b.Navigation("Extras");
 221752
 221753                    b.Navigation("Images");
 221754
 221755                    b.Navigation("ItemValues");
 221756
 221757                    b.Navigation("LinkedChildEntities");
 221758
 221759                    b.Navigation("LinkedChildOfEntities");
 221760
 221761                    b.Navigation("LockedFields");
 221762
 221763                    b.Navigation("MediaStreams");
 221764
 221765                    b.Navigation("Parents");
 221766
 221767                    b.Navigation("Peoples");
 221768
 221769                    b.Navigation("Provider");
 221770
 221771                    b.Navigation("TrailerTypes");
 221772
 221773                    b.Navigation("UserData");
 221774                });
 1775
 221776            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 221777                {
 221778                    b.Navigation("HomeSections");
 221779                });
 1780
 221781            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 221782                {
 221783                    b.Navigation("BaseItemsMap");
 221784                });
 1785
 221786            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 221787                {
 221788                    b.Navigation("BaseItems");
 221789                });
 1790
 221791            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 221792                {
 221793                    b.Navigation("AccessSchedules");
 221794
 221795                    b.Navigation("DisplayPreferences");
 221796
 221797                    b.Navigation("ItemDisplayPreferences");
 221798
 221799                    b.Navigation("Permissions");
 221800
 221801                    b.Navigation("Preferences");
 221802
 221803                    b.Navigation("ProfileImage");
 221804                });
 1805#pragma warning restore 612, 618
 221806        }
 1807    }
 1808}