< Summary - Jellyfin

Line coverage
96%
Covered lines: 1738
Uncovered lines: 55
Coverable lines: 1793
Total lines: 1901
Line coverage: 96.9%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 5/16/2026 - 12:15:55 AM Line coverage: 96.9% (1738/1793) Total lines: 1901

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/20260113102337_AddLinkedChildrenTable.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 AddLinkedChildrenTable : Migration
 10    {
 11        /// <inheritdoc />
 12        protected override void Up(MigrationBuilder migrationBuilder)
 13        {
 2714            migrationBuilder.CreateTable(
 2715                name: "LinkedChildren",
 2716                columns: table => new
 2717                {
 2718                    ParentId = table.Column<Guid>(type: "TEXT", nullable: false),
 2719                    ChildId = table.Column<Guid>(type: "TEXT", nullable: false),
 2720                    ChildType = table.Column<int>(type: "INTEGER", nullable: false),
 2721                    SortOrder = table.Column<int>(type: "INTEGER", nullable: true)
 2722                },
 2723                constraints: table =>
 2724                {
 2725                    table.PrimaryKey("PK_LinkedChildren", x => new { x.ParentId, x.ChildId });
 2726                    table.ForeignKey(
 2727                        name: "FK_LinkedChildren_BaseItems_ChildId",
 2728                        column: x => x.ChildId,
 2729                        principalTable: "BaseItems",
 2730                        principalColumn: "Id");
 2731                    table.ForeignKey(
 2732                        name: "FK_LinkedChildren_BaseItems_ParentId",
 2733                        column: x => x.ParentId,
 2734                        principalTable: "BaseItems",
 2735                        principalColumn: "Id");
 2736                });
 37
 2738            migrationBuilder.CreateIndex(
 2739                name: "IX_LinkedChildren_ChildId",
 2740                table: "LinkedChildren",
 2741                column: "ChildId");
 42
 2743            migrationBuilder.CreateIndex(
 2744                name: "IX_LinkedChildren_ChildId_ChildType",
 2745                table: "LinkedChildren",
 2746                columns: new[] { "ChildId", "ChildType" });
 47
 2748            migrationBuilder.CreateIndex(
 2749                name: "IX_LinkedChildren_ParentId",
 2750                table: "LinkedChildren",
 2751                column: "ParentId");
 52
 2753            migrationBuilder.CreateIndex(
 2754                name: "IX_LinkedChildren_ParentId_ChildType",
 2755                table: "LinkedChildren",
 2756                columns: new[] { "ParentId", "ChildType" });
 57
 2758            migrationBuilder.CreateIndex(
 2759                name: "IX_LinkedChildren_ParentId_SortOrder",
 2760                table: "LinkedChildren",
 2761                columns: new[] { "ParentId", "SortOrder" });
 2762        }
 63
 64        /// <inheritdoc />
 65        protected override void Down(MigrationBuilder migrationBuilder)
 66        {
 67            // Re-populate LinkedChildren data back into the JSON Data column before dropping the table
 068            migrationBuilder.Sql(
 069                @"UPDATE BaseItems
 070                  SET Data = CASE
 071                      WHEN Data IS NULL OR Data = '' THEN
 072                          json_object('LinkedChildren', (
 073                              SELECT json_group_array(
 074                                  json_object(
 075                                      'Path', Child.Path,
 076                                      'Type', CASE LC.ChildType
 077                                          WHEN 0 THEN 'Manual'
 078                                          WHEN 1 THEN 'Shortcut'
 079                                          ELSE 'Manual'
 080                                      END,
 081                                      'ItemId', LOWER(REPLACE(LC.ChildId, '-', ''))
 082                                  )
 083                              )
 084                              FROM LinkedChildren LC
 085                              INNER JOIN BaseItems Child ON LC.ChildId = Child.Id
 086                              WHERE LC.ParentId = BaseItems.Id
 087                              ORDER BY LC.SortOrder
 088                          ))
 089                      ELSE
 090                          json_set(
 091                              Data,
 092                              '$.LinkedChildren',
 093                              (
 094                                  SELECT json_group_array(
 095                                      json_object(
 096                                          'Path', Child.Path,
 097                                          'Type', CASE LC.ChildType
 098                                              WHEN 0 THEN 'Manual'
 099                                              WHEN 1 THEN 'Shortcut'
 0100                                              ELSE 'Manual'
 0101                                          END,
 0102                                          'ItemId', LOWER(REPLACE(LC.ChildId, '-', ''))
 0103                                      )
 0104                                  )
 0105                                  FROM LinkedChildren LC
 0106                                  INNER JOIN BaseItems Child ON LC.ChildId = Child.Id
 0107                                  WHERE LC.ParentId = BaseItems.Id
 0108                                  ORDER BY LC.SortOrder
 0109                              )
 0110                          )
 0111                  END
 0112                  WHERE EXISTS (
 0113                      SELECT 1
 0114                      FROM LinkedChildren LC
 0115                      WHERE LC.ParentId = BaseItems.Id
 0116                  )");
 117
 0118            migrationBuilder.DropTable(
 0119                name: "LinkedChildren");
 120
 0121            migrationBuilder.Sql(
 0122                @"DELETE FROM __EFMigrationsHistory
 0123                  WHERE MigrationId = '20260113120000_MigrateLinkedChildren'");
 0124        }
 125    }
 126}

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