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