< 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        {
 2114            migrationBuilder.CreateTable(
 2115                name: "LinkedChildren",
 2116                columns: table => new
 2117                {
 2118                    ParentId = table.Column<Guid>(type: "TEXT", nullable: false),
 2119                    ChildId = table.Column<Guid>(type: "TEXT", nullable: false),
 2120                    ChildType = table.Column<int>(type: "INTEGER", nullable: false),
 2121                    SortOrder = table.Column<int>(type: "INTEGER", nullable: true)
 2122                },
 2123                constraints: table =>
 2124                {
 2125                    table.PrimaryKey("PK_LinkedChildren", x => new { x.ParentId, x.ChildId });
 2126                    table.ForeignKey(
 2127                        name: "FK_LinkedChildren_BaseItems_ChildId",
 2128                        column: x => x.ChildId,
 2129                        principalTable: "BaseItems",
 2130                        principalColumn: "Id");
 2131                    table.ForeignKey(
 2132                        name: "FK_LinkedChildren_BaseItems_ParentId",
 2133                        column: x => x.ParentId,
 2134                        principalTable: "BaseItems",
 2135                        principalColumn: "Id");
 2136                });
 37
 2138            migrationBuilder.CreateIndex(
 2139                name: "IX_LinkedChildren_ChildId",
 2140                table: "LinkedChildren",
 2141                column: "ChildId");
 42
 2143            migrationBuilder.CreateIndex(
 2144                name: "IX_LinkedChildren_ChildId_ChildType",
 2145                table: "LinkedChildren",
 2146                columns: new[] { "ChildId", "ChildType" });
 47
 2148            migrationBuilder.CreateIndex(
 2149                name: "IX_LinkedChildren_ParentId",
 2150                table: "LinkedChildren",
 2151                column: "ParentId");
 52
 2153            migrationBuilder.CreateIndex(
 2154                name: "IX_LinkedChildren_ParentId_ChildType",
 2155                table: "LinkedChildren",
 2156                columns: new[] { "ParentId", "ChildType" });
 57
 2158            migrationBuilder.CreateIndex(
 2159                name: "IX_LinkedChildren_ParentId_SortOrder",
 2160                table: "LinkedChildren",
 2161                columns: new[] { "ParentId", "SortOrder" });
 2162        }
 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
 2121            modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
 22
 2123            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 2124                {
 2125                    b.Property<int>("Id")
 2126                        .ValueGeneratedOnAdd()
 2127                        .HasColumnType("INTEGER");
 2128
 2129                    b.Property<int>("DayOfWeek")
 2130                        .HasColumnType("INTEGER");
 2131
 2132                    b.Property<double>("EndHour")
 2133                        .HasColumnType("REAL");
 2134
 2135                    b.Property<double>("StartHour")
 2136                        .HasColumnType("REAL");
 2137
 2138                    b.Property<Guid>("UserId")
 2139                        .HasColumnType("TEXT");
 2140
 2141                    b.HasKey("Id");
 2142
 2143                    b.HasIndex("UserId");
 2144
 2145                    b.ToTable("AccessSchedules");
 2146
 2147                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 2148                });
 49
 2150            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ActivityLog", b =>
 2151                {
 2152                    b.Property<int>("Id")
 2153                        .ValueGeneratedOnAdd()
 2154                        .HasColumnType("INTEGER");
 2155
 2156                    b.Property<DateTime>("DateCreated")
 2157                        .HasColumnType("TEXT");
 2158
 2159                    b.Property<string>("ItemId")
 2160                        .HasMaxLength(256)
 2161                        .HasColumnType("TEXT");
 2162
 2163                    b.Property<int>("LogSeverity")
 2164                        .HasColumnType("INTEGER");
 2165
 2166                    b.Property<string>("Name")
 2167                        .IsRequired()
 2168                        .HasMaxLength(512)
 2169                        .HasColumnType("TEXT");
 2170
 2171                    b.Property<string>("Overview")
 2172                        .HasMaxLength(512)
 2173                        .HasColumnType("TEXT");
 2174
 2175                    b.Property<uint>("RowVersion")
 2176                        .IsConcurrencyToken()
 2177                        .HasColumnType("INTEGER");
 2178
 2179                    b.Property<string>("ShortOverview")
 2180                        .HasMaxLength(512)
 2181                        .HasColumnType("TEXT");
 2182
 2183                    b.Property<string>("Type")
 2184                        .IsRequired()
 2185                        .HasMaxLength(256)
 2186                        .HasColumnType("TEXT");
 2187
 2188                    b.Property<Guid>("UserId")
 2189                        .HasColumnType("TEXT");
 2190
 2191                    b.HasKey("Id");
 2192
 2193                    b.HasIndex("DateCreated");
 2194
 2195                    b.ToTable("ActivityLogs");
 2196
 2197                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 2198                });
 99
 21100            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 21101                {
 21102                    b.Property<Guid>("ItemId")
 21103                        .HasColumnType("TEXT");
 21104
 21105                    b.Property<Guid>("ParentItemId")
 21106                        .HasColumnType("TEXT");
 21107
 21108                    b.HasKey("ItemId", "ParentItemId");
 21109
 21110                    b.HasIndex("ParentItemId");
 21111
 21112                    b.ToTable("AncestorIds");
 21113
 21114                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21115                });
 116
 21117            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 21118                {
 21119                    b.Property<Guid>("ItemId")
 21120                        .HasColumnType("TEXT");
 21121
 21122                    b.Property<int>("Index")
 21123                        .HasColumnType("INTEGER");
 21124
 21125                    b.Property<string>("Codec")
 21126                        .HasColumnType("TEXT");
 21127
 21128                    b.Property<string>("CodecTag")
 21129                        .HasColumnType("TEXT");
 21130
 21131                    b.Property<string>("Comment")
 21132                        .HasColumnType("TEXT");
 21133
 21134                    b.Property<string>("Filename")
 21135                        .HasColumnType("TEXT");
 21136
 21137                    b.Property<string>("MimeType")
 21138                        .HasColumnType("TEXT");
 21139
 21140                    b.HasKey("ItemId", "Index");
 21141
 21142                    b.ToTable("AttachmentStreamInfos");
 21143
 21144                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21145                });
 146
 21147            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 21148                {
 21149                    b.Property<Guid>("Id")
 21150                        .ValueGeneratedOnAdd()
 21151                        .HasColumnType("TEXT");
 21152
 21153                    b.Property<string>("Album")
 21154                        .HasColumnType("TEXT");
 21155
 21156                    b.Property<string>("AlbumArtists")
 21157                        .HasColumnType("TEXT");
 21158
 21159                    b.Property<string>("Artists")
 21160                        .HasColumnType("TEXT");
 21161
 21162                    b.Property<int?>("Audio")
 21163                        .HasColumnType("INTEGER");
 21164
 21165                    b.Property<Guid?>("ChannelId")
 21166                        .HasColumnType("TEXT");
 21167
 21168                    b.Property<string>("CleanName")
 21169                        .HasColumnType("TEXT");
 21170
 21171                    b.Property<float?>("CommunityRating")
 21172                        .HasColumnType("REAL");
 21173
 21174                    b.Property<float?>("CriticRating")
 21175                        .HasColumnType("REAL");
 21176
 21177                    b.Property<string>("CustomRating")
 21178                        .HasColumnType("TEXT");
 21179
 21180                    b.Property<string>("Data")
 21181                        .HasColumnType("TEXT");
 21182
 21183                    b.Property<DateTime?>("DateCreated")
 21184                        .HasColumnType("TEXT");
 21185
 21186                    b.Property<DateTime?>("DateLastMediaAdded")
 21187                        .HasColumnType("TEXT");
 21188
 21189                    b.Property<DateTime?>("DateLastRefreshed")
 21190                        .HasColumnType("TEXT");
 21191
 21192                    b.Property<DateTime?>("DateLastSaved")
 21193                        .HasColumnType("TEXT");
 21194
 21195                    b.Property<DateTime?>("DateModified")
 21196                        .HasColumnType("TEXT");
 21197
 21198                    b.Property<DateTime?>("EndDate")
 21199                        .HasColumnType("TEXT");
 21200
 21201                    b.Property<string>("EpisodeTitle")
 21202                        .HasColumnType("TEXT");
 21203
 21204                    b.Property<string>("ExternalId")
 21205                        .HasColumnType("TEXT");
 21206
 21207                    b.Property<string>("ExternalSeriesId")
 21208                        .HasColumnType("TEXT");
 21209
 21210                    b.Property<string>("ExternalServiceId")
 21211                        .HasColumnType("TEXT");
 21212
 21213                    b.Property<string>("ExtraIds")
 21214                        .HasColumnType("TEXT");
 21215
 21216                    b.Property<int?>("ExtraType")
 21217                        .HasColumnType("INTEGER");
 21218
 21219                    b.Property<string>("ForcedSortName")
 21220                        .HasColumnType("TEXT");
 21221
 21222                    b.Property<string>("Genres")
 21223                        .HasColumnType("TEXT");
 21224
 21225                    b.Property<int?>("Height")
 21226                        .HasColumnType("INTEGER");
 21227
 21228                    b.Property<int?>("IndexNumber")
 21229                        .HasColumnType("INTEGER");
 21230
 21231                    b.Property<int?>("InheritedParentalRatingSubValue")
 21232                        .HasColumnType("INTEGER");
 21233
 21234                    b.Property<int?>("InheritedParentalRatingValue")
 21235                        .HasColumnType("INTEGER");
 21236
 21237                    b.Property<bool>("IsFolder")
 21238                        .HasColumnType("INTEGER");
 21239
 21240                    b.Property<bool>("IsInMixedFolder")
 21241                        .HasColumnType("INTEGER");
 21242
 21243                    b.Property<bool>("IsLocked")
 21244                        .HasColumnType("INTEGER");
 21245
 21246                    b.Property<bool>("IsMovie")
 21247                        .HasColumnType("INTEGER");
 21248
 21249                    b.Property<bool>("IsRepeat")
 21250                        .HasColumnType("INTEGER");
 21251
 21252                    b.Property<bool>("IsSeries")
 21253                        .HasColumnType("INTEGER");
 21254
 21255                    b.Property<bool>("IsVirtualItem")
 21256                        .HasColumnType("INTEGER");
 21257
 21258                    b.Property<float?>("LUFS")
 21259                        .HasColumnType("REAL");
 21260
 21261                    b.Property<string>("MediaType")
 21262                        .HasColumnType("TEXT");
 21263
 21264                    b.Property<string>("Name")
 21265                        .HasColumnType("TEXT");
 21266
 21267                    b.Property<float?>("NormalizationGain")
 21268                        .HasColumnType("REAL");
 21269
 21270                    b.Property<string>("OfficialRating")
 21271                        .HasColumnType("TEXT");
 21272
 21273                    b.Property<string>("OriginalTitle")
 21274                        .HasColumnType("TEXT");
 21275
 21276                    b.Property<string>("Overview")
 21277                        .HasColumnType("TEXT");
 21278
 21279                    b.Property<string>("OwnerId")
 21280                        .HasColumnType("TEXT");
 21281
 21282                    b.Property<Guid?>("ParentId")
 21283                        .HasColumnType("TEXT");
 21284
 21285                    b.Property<int?>("ParentIndexNumber")
 21286                        .HasColumnType("INTEGER");
 21287
 21288                    b.Property<string>("Path")
 21289                        .HasColumnType("TEXT");
 21290
 21291                    b.Property<string>("PreferredMetadataCountryCode")
 21292                        .HasColumnType("TEXT");
 21293
 21294                    b.Property<string>("PreferredMetadataLanguage")
 21295                        .HasColumnType("TEXT");
 21296
 21297                    b.Property<DateTime?>("PremiereDate")
 21298                        .HasColumnType("TEXT");
 21299
 21300                    b.Property<string>("PresentationUniqueKey")
 21301                        .HasColumnType("TEXT");
 21302
 21303                    b.Property<string>("PrimaryVersionId")
 21304                        .HasColumnType("TEXT");
 21305
 21306                    b.Property<string>("ProductionLocations")
 21307                        .HasColumnType("TEXT");
 21308
 21309                    b.Property<int?>("ProductionYear")
 21310                        .HasColumnType("INTEGER");
 21311
 21312                    b.Property<long?>("RunTimeTicks")
 21313                        .HasColumnType("INTEGER");
 21314
 21315                    b.Property<Guid?>("SeasonId")
 21316                        .HasColumnType("TEXT");
 21317
 21318                    b.Property<string>("SeasonName")
 21319                        .HasColumnType("TEXT");
 21320
 21321                    b.Property<Guid?>("SeriesId")
 21322                        .HasColumnType("TEXT");
 21323
 21324                    b.Property<string>("SeriesName")
 21325                        .HasColumnType("TEXT");
 21326
 21327                    b.Property<string>("SeriesPresentationUniqueKey")
 21328                        .HasColumnType("TEXT");
 21329
 21330                    b.Property<string>("ShowId")
 21331                        .HasColumnType("TEXT");
 21332
 21333                    b.Property<long?>("Size")
 21334                        .HasColumnType("INTEGER");
 21335
 21336                    b.Property<string>("SortName")
 21337                        .HasColumnType("TEXT");
 21338
 21339                    b.Property<DateTime?>("StartDate")
 21340                        .HasColumnType("TEXT");
 21341
 21342                    b.Property<string>("Studios")
 21343                        .HasColumnType("TEXT");
 21344
 21345                    b.Property<string>("Tagline")
 21346                        .HasColumnType("TEXT");
 21347
 21348                    b.Property<string>("Tags")
 21349                        .HasColumnType("TEXT");
 21350
 21351                    b.Property<Guid?>("TopParentId")
 21352                        .HasColumnType("TEXT");
 21353
 21354                    b.Property<int?>("TotalBitrate")
 21355                        .HasColumnType("INTEGER");
 21356
 21357                    b.Property<string>("Type")
 21358                        .IsRequired()
 21359                        .HasColumnType("TEXT");
 21360
 21361                    b.Property<string>("UnratedType")
 21362                        .HasColumnType("TEXT");
 21363
 21364                    b.Property<int?>("Width")
 21365                        .HasColumnType("INTEGER");
 21366
 21367                    b.HasKey("Id");
 21368
 21369                    b.HasIndex("ParentId");
 21370
 21371                    b.HasIndex("Path");
 21372
 21373                    b.HasIndex("PresentationUniqueKey");
 21374
 21375                    b.HasIndex("TopParentId", "Id");
 21376
 21377                    b.HasIndex("Type", "TopParentId", "Id");
 21378
 21379                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 21380
 21381                    b.HasIndex("Type", "TopParentId", "StartDate");
 21382
 21383                    b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem");
 21384
 21385                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 21386
 21387                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 21388
 21389                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 21390
 21391                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 21392
 21393                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 21394
 21395                    b.ToTable("BaseItems");
 21396
 21397                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21398
 21399                    b.HasData(
 21400                        new
 21401                        {
 21402                            Id = new Guid("00000000-0000-0000-0000-000000000001"),
 21403                            IsFolder = false,
 21404                            IsInMixedFolder = false,
 21405                            IsLocked = false,
 21406                            IsMovie = false,
 21407                            IsRepeat = false,
 21408                            IsSeries = false,
 21409                            IsVirtualItem = false,
 21410                            Name = "This is a placeholder item for UserData that has been detacted from its original ite
 21411                            Type = "PLACEHOLDER"
 21412                        });
 21413                });
 414
 21415            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 21416                {
 21417                    b.Property<Guid>("Id")
 21418                        .ValueGeneratedOnAdd()
 21419                        .HasColumnType("TEXT");
 21420
 21421                    b.Property<byte[]>("Blurhash")
 21422                        .HasColumnType("BLOB");
 21423
 21424                    b.Property<DateTime?>("DateModified")
 21425                        .HasColumnType("TEXT");
 21426
 21427                    b.Property<int>("Height")
 21428                        .HasColumnType("INTEGER");
 21429
 21430                    b.Property<int>("ImageType")
 21431                        .HasColumnType("INTEGER");
 21432
 21433                    b.Property<Guid>("ItemId")
 21434                        .HasColumnType("TEXT");
 21435
 21436                    b.Property<string>("Path")
 21437                        .IsRequired()
 21438                        .HasColumnType("TEXT");
 21439
 21440                    b.Property<int>("Width")
 21441                        .HasColumnType("INTEGER");
 21442
 21443                    b.HasKey("Id");
 21444
 21445                    b.HasIndex("ItemId");
 21446
 21447                    b.ToTable("BaseItemImageInfos");
 21448
 21449                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21450                });
 451
 21452            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 21453                {
 21454                    b.Property<int>("Id")
 21455                        .HasColumnType("INTEGER");
 21456
 21457                    b.Property<Guid>("ItemId")
 21458                        .HasColumnType("TEXT");
 21459
 21460                    b.HasKey("Id", "ItemId");
 21461
 21462                    b.HasIndex("ItemId");
 21463
 21464                    b.ToTable("BaseItemMetadataFields");
 21465
 21466                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21467                });
 468
 21469            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 21470                {
 21471                    b.Property<Guid>("ItemId")
 21472                        .HasColumnType("TEXT");
 21473
 21474                    b.Property<string>("ProviderId")
 21475                        .HasColumnType("TEXT");
 21476
 21477                    b.Property<string>("ProviderValue")
 21478                        .IsRequired()
 21479                        .HasColumnType("TEXT");
 21480
 21481                    b.HasKey("ItemId", "ProviderId");
 21482
 21483                    b.HasIndex("ProviderId", "ProviderValue", "ItemId");
 21484
 21485                    b.ToTable("BaseItemProviders");
 21486
 21487                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21488                });
 489
 21490            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 21491                {
 21492                    b.Property<int>("Id")
 21493                        .HasColumnType("INTEGER");
 21494
 21495                    b.Property<Guid>("ItemId")
 21496                        .HasColumnType("TEXT");
 21497
 21498                    b.HasKey("Id", "ItemId");
 21499
 21500                    b.HasIndex("ItemId");
 21501
 21502                    b.ToTable("BaseItemTrailerTypes");
 21503
 21504                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21505                });
 506
 21507            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 21508                {
 21509                    b.Property<Guid>("ItemId")
 21510                        .HasColumnType("TEXT");
 21511
 21512                    b.Property<int>("ChapterIndex")
 21513                        .HasColumnType("INTEGER");
 21514
 21515                    b.Property<DateTime?>("ImageDateModified")
 21516                        .HasColumnType("TEXT");
 21517
 21518                    b.Property<string>("ImagePath")
 21519                        .HasColumnType("TEXT");
 21520
 21521                    b.Property<string>("Name")
 21522                        .HasColumnType("TEXT");
 21523
 21524                    b.Property<long>("StartPositionTicks")
 21525                        .HasColumnType("INTEGER");
 21526
 21527                    b.HasKey("ItemId", "ChapterIndex");
 21528
 21529                    b.ToTable("Chapters");
 21530
 21531                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21532                });
 533
 21534            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.CustomItemDisplayPreferences", b =>
 21535                {
 21536                    b.Property<int>("Id")
 21537                        .ValueGeneratedOnAdd()
 21538                        .HasColumnType("INTEGER");
 21539
 21540                    b.Property<string>("Client")
 21541                        .IsRequired()
 21542                        .HasMaxLength(32)
 21543                        .HasColumnType("TEXT");
 21544
 21545                    b.Property<Guid>("ItemId")
 21546                        .HasColumnType("TEXT");
 21547
 21548                    b.Property<string>("Key")
 21549                        .IsRequired()
 21550                        .HasColumnType("TEXT");
 21551
 21552                    b.Property<Guid>("UserId")
 21553                        .HasColumnType("TEXT");
 21554
 21555                    b.Property<string>("Value")
 21556                        .HasColumnType("TEXT");
 21557
 21558                    b.HasKey("Id");
 21559
 21560                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 21561                        .IsUnique();
 21562
 21563                    b.ToTable("CustomItemDisplayPreferences");
 21564
 21565                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21566                });
 567
 21568            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 21569                {
 21570                    b.Property<int>("Id")
 21571                        .ValueGeneratedOnAdd()
 21572                        .HasColumnType("INTEGER");
 21573
 21574                    b.Property<int>("ChromecastVersion")
 21575                        .HasColumnType("INTEGER");
 21576
 21577                    b.Property<string>("Client")
 21578                        .IsRequired()
 21579                        .HasMaxLength(32)
 21580                        .HasColumnType("TEXT");
 21581
 21582                    b.Property<string>("DashboardTheme")
 21583                        .HasMaxLength(32)
 21584                        .HasColumnType("TEXT");
 21585
 21586                    b.Property<bool>("EnableNextVideoInfoOverlay")
 21587                        .HasColumnType("INTEGER");
 21588
 21589                    b.Property<int?>("IndexBy")
 21590                        .HasColumnType("INTEGER");
 21591
 21592                    b.Property<Guid>("ItemId")
 21593                        .HasColumnType("TEXT");
 21594
 21595                    b.Property<int>("ScrollDirection")
 21596                        .HasColumnType("INTEGER");
 21597
 21598                    b.Property<bool>("ShowBackdrop")
 21599                        .HasColumnType("INTEGER");
 21600
 21601                    b.Property<bool>("ShowSidebar")
 21602                        .HasColumnType("INTEGER");
 21603
 21604                    b.Property<int>("SkipBackwardLength")
 21605                        .HasColumnType("INTEGER");
 21606
 21607                    b.Property<int>("SkipForwardLength")
 21608                        .HasColumnType("INTEGER");
 21609
 21610                    b.Property<string>("TvHome")
 21611                        .HasMaxLength(32)
 21612                        .HasColumnType("TEXT");
 21613
 21614                    b.Property<Guid>("UserId")
 21615                        .HasColumnType("TEXT");
 21616
 21617                    b.HasKey("Id");
 21618
 21619                    b.HasIndex("UserId", "ItemId", "Client")
 21620                        .IsUnique();
 21621
 21622                    b.ToTable("DisplayPreferences");
 21623
 21624                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21625                });
 626
 21627            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 21628                {
 21629                    b.Property<int>("Id")
 21630                        .ValueGeneratedOnAdd()
 21631                        .HasColumnType("INTEGER");
 21632
 21633                    b.Property<int>("DisplayPreferencesId")
 21634                        .HasColumnType("INTEGER");
 21635
 21636                    b.Property<int>("Order")
 21637                        .HasColumnType("INTEGER");
 21638
 21639                    b.Property<int>("Type")
 21640                        .HasColumnType("INTEGER");
 21641
 21642                    b.HasKey("Id");
 21643
 21644                    b.HasIndex("DisplayPreferencesId");
 21645
 21646                    b.ToTable("HomeSection");
 21647
 21648                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21649                });
 650
 21651            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 21652                {
 21653                    b.Property<int>("Id")
 21654                        .ValueGeneratedOnAdd()
 21655                        .HasColumnType("INTEGER");
 21656
 21657                    b.Property<DateTime>("LastModified")
 21658                        .HasColumnType("TEXT");
 21659
 21660                    b.Property<string>("Path")
 21661                        .IsRequired()
 21662                        .HasMaxLength(512)
 21663                        .HasColumnType("TEXT");
 21664
 21665                    b.Property<Guid?>("UserId")
 21666                        .HasColumnType("TEXT");
 21667
 21668                    b.HasKey("Id");
 21669
 21670                    b.HasIndex("UserId")
 21671                        .IsUnique();
 21672
 21673                    b.ToTable("ImageInfos");
 21674
 21675                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21676                });
 677
 21678            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 21679                {
 21680                    b.Property<int>("Id")
 21681                        .ValueGeneratedOnAdd()
 21682                        .HasColumnType("INTEGER");
 21683
 21684                    b.Property<string>("Client")
 21685                        .IsRequired()
 21686                        .HasMaxLength(32)
 21687                        .HasColumnType("TEXT");
 21688
 21689                    b.Property<int?>("IndexBy")
 21690                        .HasColumnType("INTEGER");
 21691
 21692                    b.Property<Guid>("ItemId")
 21693                        .HasColumnType("TEXT");
 21694
 21695                    b.Property<bool>("RememberIndexing")
 21696                        .HasColumnType("INTEGER");
 21697
 21698                    b.Property<bool>("RememberSorting")
 21699                        .HasColumnType("INTEGER");
 21700
 21701                    b.Property<string>("SortBy")
 21702                        .IsRequired()
 21703                        .HasMaxLength(64)
 21704                        .HasColumnType("TEXT");
 21705
 21706                    b.Property<int>("SortOrder")
 21707                        .HasColumnType("INTEGER");
 21708
 21709                    b.Property<Guid>("UserId")
 21710                        .HasColumnType("TEXT");
 21711
 21712                    b.Property<int>("ViewType")
 21713                        .HasColumnType("INTEGER");
 21714
 21715                    b.HasKey("Id");
 21716
 21717                    b.HasIndex("UserId");
 21718
 21719                    b.ToTable("ItemDisplayPreferences");
 21720
 21721                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21722                });
 723
 21724            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 21725                {
 21726                    b.Property<Guid>("ItemValueId")
 21727                        .ValueGeneratedOnAdd()
 21728                        .HasColumnType("TEXT");
 21729
 21730                    b.Property<string>("CleanValue")
 21731                        .IsRequired()
 21732                        .HasColumnType("TEXT");
 21733
 21734                    b.Property<int>("Type")
 21735                        .HasColumnType("INTEGER");
 21736
 21737                    b.Property<string>("Value")
 21738                        .IsRequired()
 21739                        .HasColumnType("TEXT");
 21740
 21741                    b.HasKey("ItemValueId");
 21742
 21743                    b.HasIndex("Type", "CleanValue");
 21744
 21745                    b.HasIndex("Type", "Value")
 21746                        .IsUnique();
 21747
 21748                    b.ToTable("ItemValues");
 21749
 21750                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21751                });
 752
 21753            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 21754                {
 21755                    b.Property<Guid>("ItemValueId")
 21756                        .HasColumnType("TEXT");
 21757
 21758                    b.Property<Guid>("ItemId")
 21759                        .HasColumnType("TEXT");
 21760
 21761                    b.HasKey("ItemValueId", "ItemId");
 21762
 21763                    b.HasIndex("ItemId");
 21764
 21765                    b.ToTable("ItemValuesMap");
 21766
 21767                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21768                });
 769
 21770            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 21771                {
 21772                    b.Property<Guid>("ItemId")
 21773                        .HasColumnType("TEXT");
 21774
 21775                    b.PrimitiveCollection<string>("KeyframeTicks")
 21776                        .HasColumnType("TEXT");
 21777
 21778                    b.Property<long>("TotalDuration")
 21779                        .HasColumnType("INTEGER");
 21780
 21781                    b.HasKey("ItemId");
 21782
 21783                    b.ToTable("KeyframeData");
 21784
 21785                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21786                });
 787
 21788            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 21789                {
 21790                    b.Property<Guid>("ParentId")
 21791                        .HasColumnType("TEXT");
 21792
 21793                    b.Property<Guid>("ChildId")
 21794                        .HasColumnType("TEXT");
 21795
 21796                    b.Property<int>("ChildType")
 21797                        .HasColumnType("INTEGER");
 21798
 21799                    b.Property<int?>("SortOrder")
 21800                        .HasColumnType("INTEGER");
 21801
 21802                    b.HasKey("ParentId", "ChildId");
 21803
 21804                    b.HasIndex("ChildId");
 21805
 21806                    b.HasIndex("ParentId");
 21807
 21808                    b.HasIndex("ChildId", "ChildType");
 21809
 21810                    b.HasIndex("ParentId", "ChildType");
 21811
 21812                    b.HasIndex("ParentId", "SortOrder");
 21813
 21814                    b.ToTable("LinkedChildren", (string)null);
 21815
 21816                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21817                });
 818
 21819            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaSegment", b =>
 21820                {
 21821                    b.Property<Guid>("Id")
 21822                        .ValueGeneratedOnAdd()
 21823                        .HasColumnType("TEXT");
 21824
 21825                    b.Property<long>("EndTicks")
 21826                        .HasColumnType("INTEGER");
 21827
 21828                    b.Property<Guid>("ItemId")
 21829                        .HasColumnType("TEXT");
 21830
 21831                    b.Property<string>("SegmentProviderId")
 21832                        .IsRequired()
 21833                        .HasColumnType("TEXT");
 21834
 21835                    b.Property<long>("StartTicks")
 21836                        .HasColumnType("INTEGER");
 21837
 21838                    b.Property<int>("Type")
 21839                        .HasColumnType("INTEGER");
 21840
 21841                    b.HasKey("Id");
 21842
 21843                    b.ToTable("MediaSegments");
 21844
 21845                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 21846                });
 847
 21848            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 21849                {
 21850                    b.Property<Guid>("ItemId")
 21851                        .HasColumnType("TEXT");
 21852
 21853                    b.Property<int>("StreamIndex")
 21854                        .HasColumnType("INTEGER");
 21855
 21856                    b.Property<string>("AspectRatio")
 21857                        .HasColumnType("TEXT");
 21858
 21859                    b.Property<float?>("AverageFrameRate")
 21860                        .HasColumnType("REAL");
 21861
 21862                    b.Property<int?>("BitDepth")
 21863                        .HasColumnType("INTEGER");
 21864
 21865                    b.Property<int?>("BitRate")
 21866                        .HasColumnType("INTEGER");
 21867
 21868                    b.Property<int?>("BlPresentFlag")
 21869                        .HasColumnType("INTEGER");
 21870
 21871                    b.Property<string>("ChannelLayout")
 21872                        .HasColumnType("TEXT");
 21873
 21874                    b.Property<int?>("Channels")
 21875                        .HasColumnType("INTEGER");
 21876
 21877                    b.Property<string>("Codec")
 21878                        .HasColumnType("TEXT");
 21879
 21880                    b.Property<string>("CodecTag")
 21881                        .HasColumnType("TEXT");
 21882
 21883                    b.Property<string>("CodecTimeBase")
 21884                        .HasColumnType("TEXT");
 21885
 21886                    b.Property<string>("ColorPrimaries")
 21887                        .HasColumnType("TEXT");
 21888
 21889                    b.Property<string>("ColorSpace")
 21890                        .HasColumnType("TEXT");
 21891
 21892                    b.Property<string>("ColorTransfer")
 21893                        .HasColumnType("TEXT");
 21894
 21895                    b.Property<string>("Comment")
 21896                        .HasColumnType("TEXT");
 21897
 21898                    b.Property<int?>("DvBlSignalCompatibilityId")
 21899                        .HasColumnType("INTEGER");
 21900
 21901                    b.Property<int?>("DvLevel")
 21902                        .HasColumnType("INTEGER");
 21903
 21904                    b.Property<int?>("DvProfile")
 21905                        .HasColumnType("INTEGER");
 21906
 21907                    b.Property<int?>("DvVersionMajor")
 21908                        .HasColumnType("INTEGER");
 21909
 21910                    b.Property<int?>("DvVersionMinor")
 21911                        .HasColumnType("INTEGER");
 21912
 21913                    b.Property<int?>("ElPresentFlag")
 21914                        .HasColumnType("INTEGER");
 21915
 21916                    b.Property<bool?>("Hdr10PlusPresentFlag")
 21917                        .HasColumnType("INTEGER");
 21918
 21919                    b.Property<int?>("Height")
 21920                        .HasColumnType("INTEGER");
 21921
 21922                    b.Property<bool?>("IsAnamorphic")
 21923                        .HasColumnType("INTEGER");
 21924
 21925                    b.Property<bool?>("IsAvc")
 21926                        .HasColumnType("INTEGER");
 21927
 21928                    b.Property<bool>("IsDefault")
 21929                        .HasColumnType("INTEGER");
 21930
 21931                    b.Property<bool>("IsExternal")
 21932                        .HasColumnType("INTEGER");
 21933
 21934                    b.Property<bool>("IsForced")
 21935                        .HasColumnType("INTEGER");
 21936
 21937                    b.Property<bool?>("IsHearingImpaired")
 21938                        .HasColumnType("INTEGER");
 21939
 21940                    b.Property<bool?>("IsInterlaced")
 21941                        .HasColumnType("INTEGER");
 21942
 21943                    b.Property<string>("KeyFrames")
 21944                        .HasColumnType("TEXT");
 21945
 21946                    b.Property<string>("Language")
 21947                        .HasColumnType("TEXT");
 21948
 21949                    b.Property<float?>("Level")
 21950                        .HasColumnType("REAL");
 21951
 21952                    b.Property<string>("NalLengthSize")
 21953                        .HasColumnType("TEXT");
 21954
 21955                    b.Property<string>("Path")
 21956                        .HasColumnType("TEXT");
 21957
 21958                    b.Property<string>("PixelFormat")
 21959                        .HasColumnType("TEXT");
 21960
 21961                    b.Property<string>("Profile")
 21962                        .HasColumnType("TEXT");
 21963
 21964                    b.Property<float?>("RealFrameRate")
 21965                        .HasColumnType("REAL");
 21966
 21967                    b.Property<int?>("RefFrames")
 21968                        .HasColumnType("INTEGER");
 21969
 21970                    b.Property<int?>("Rotation")
 21971                        .HasColumnType("INTEGER");
 21972
 21973                    b.Property<int?>("RpuPresentFlag")
 21974                        .HasColumnType("INTEGER");
 21975
 21976                    b.Property<int?>("SampleRate")
 21977                        .HasColumnType("INTEGER");
 21978
 21979                    b.Property<int>("StreamType")
 21980                        .HasColumnType("INTEGER");
 21981
 21982                    b.Property<string>("TimeBase")
 21983                        .HasColumnType("TEXT");
 21984
 21985                    b.Property<string>("Title")
 21986                        .HasColumnType("TEXT");
 21987
 21988                    b.Property<int?>("Width")
 21989                        .HasColumnType("INTEGER");
 21990
 21991                    b.HasKey("ItemId", "StreamIndex");
 21992
 21993                    b.HasIndex("StreamIndex");
 21994
 21995                    b.HasIndex("StreamType");
 21996
 21997                    b.HasIndex("StreamIndex", "StreamType");
 21998
 21999                    b.HasIndex("StreamIndex", "StreamType", "Language");
 211000
 211001                    b.ToTable("MediaStreamInfos");
 211002
 211003                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211004                });
 1005
 211006            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 211007                {
 211008                    b.Property<Guid>("Id")
 211009                        .ValueGeneratedOnAdd()
 211010                        .HasColumnType("TEXT");
 211011
 211012                    b.Property<string>("Name")
 211013                        .IsRequired()
 211014                        .HasColumnType("TEXT");
 211015
 211016                    b.Property<string>("PersonType")
 211017                        .HasColumnType("TEXT");
 211018
 211019                    b.HasKey("Id");
 211020
 211021                    b.HasIndex("Name");
 211022
 211023                    b.ToTable("Peoples");
 211024
 211025                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211026                });
 1027
 211028            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 211029                {
 211030                    b.Property<Guid>("ItemId")
 211031                        .HasColumnType("TEXT");
 211032
 211033                    b.Property<Guid>("PeopleId")
 211034                        .HasColumnType("TEXT");
 211035
 211036                    b.Property<string>("Role")
 211037                        .HasColumnType("TEXT");
 211038
 211039                    b.Property<int?>("ListOrder")
 211040                        .HasColumnType("INTEGER");
 211041
 211042                    b.Property<int?>("SortOrder")
 211043                        .HasColumnType("INTEGER");
 211044
 211045                    b.HasKey("ItemId", "PeopleId", "Role");
 211046
 211047                    b.HasIndex("PeopleId");
 211048
 211049                    b.HasIndex("ItemId", "ListOrder");
 211050
 211051                    b.HasIndex("ItemId", "SortOrder");
 211052
 211053                    b.ToTable("PeopleBaseItemMap");
 211054
 211055                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211056                });
 1057
 211058            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 211059                {
 211060                    b.Property<int>("Id")
 211061                        .ValueGeneratedOnAdd()
 211062                        .HasColumnType("INTEGER");
 211063
 211064                    b.Property<int>("Kind")
 211065                        .HasColumnType("INTEGER");
 211066
 211067                    b.Property<Guid?>("Permission_Permissions_Guid")
 211068                        .HasColumnType("TEXT");
 211069
 211070                    b.Property<uint>("RowVersion")
 211071                        .IsConcurrencyToken()
 211072                        .HasColumnType("INTEGER");
 211073
 211074                    b.Property<Guid?>("UserId")
 211075                        .HasColumnType("TEXT");
 211076
 211077                    b.Property<bool>("Value")
 211078                        .HasColumnType("INTEGER");
 211079
 211080                    b.HasKey("Id");
 211081
 211082                    b.HasIndex("UserId", "Kind")
 211083                        .IsUnique()
 211084                        .HasFilter("[UserId] IS NOT NULL");
 211085
 211086                    b.ToTable("Permissions");
 211087
 211088                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211089                });
 1090
 211091            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 211092                {
 211093                    b.Property<int>("Id")
 211094                        .ValueGeneratedOnAdd()
 211095                        .HasColumnType("INTEGER");
 211096
 211097                    b.Property<int>("Kind")
 211098                        .HasColumnType("INTEGER");
 211099
 211100                    b.Property<Guid?>("Preference_Preferences_Guid")
 211101                        .HasColumnType("TEXT");
 211102
 211103                    b.Property<uint>("RowVersion")
 211104                        .IsConcurrencyToken()
 211105                        .HasColumnType("INTEGER");
 211106
 211107                    b.Property<Guid?>("UserId")
 211108                        .HasColumnType("TEXT");
 211109
 211110                    b.Property<string>("Value")
 211111                        .IsRequired()
 211112                        .HasMaxLength(65535)
 211113                        .HasColumnType("TEXT");
 211114
 211115                    b.HasKey("Id");
 211116
 211117                    b.HasIndex("UserId", "Kind")
 211118                        .IsUnique()
 211119                        .HasFilter("[UserId] IS NOT NULL");
 211120
 211121                    b.ToTable("Preferences");
 211122
 211123                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211124                });
 1125
 211126            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.ApiKey", b =>
 211127                {
 211128                    b.Property<int>("Id")
 211129                        .ValueGeneratedOnAdd()
 211130                        .HasColumnType("INTEGER");
 211131
 211132                    b.Property<string>("AccessToken")
 211133                        .IsRequired()
 211134                        .HasColumnType("TEXT");
 211135
 211136                    b.Property<DateTime>("DateCreated")
 211137                        .HasColumnType("TEXT");
 211138
 211139                    b.Property<DateTime>("DateLastActivity")
 211140                        .HasColumnType("TEXT");
 211141
 211142                    b.Property<string>("Name")
 211143                        .IsRequired()
 211144                        .HasMaxLength(64)
 211145                        .HasColumnType("TEXT");
 211146
 211147                    b.HasKey("Id");
 211148
 211149                    b.HasIndex("AccessToken")
 211150                        .IsUnique();
 211151
 211152                    b.ToTable("ApiKeys");
 211153
 211154                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211155                });
 1156
 211157            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 211158                {
 211159                    b.Property<int>("Id")
 211160                        .ValueGeneratedOnAdd()
 211161                        .HasColumnType("INTEGER");
 211162
 211163                    b.Property<string>("AccessToken")
 211164                        .IsRequired()
 211165                        .HasColumnType("TEXT");
 211166
 211167                    b.Property<string>("AppName")
 211168                        .IsRequired()
 211169                        .HasMaxLength(64)
 211170                        .HasColumnType("TEXT");
 211171
 211172                    b.Property<string>("AppVersion")
 211173                        .IsRequired()
 211174                        .HasMaxLength(32)
 211175                        .HasColumnType("TEXT");
 211176
 211177                    b.Property<DateTime>("DateCreated")
 211178                        .HasColumnType("TEXT");
 211179
 211180                    b.Property<DateTime>("DateLastActivity")
 211181                        .HasColumnType("TEXT");
 211182
 211183                    b.Property<DateTime>("DateModified")
 211184                        .HasColumnType("TEXT");
 211185
 211186                    b.Property<string>("DeviceId")
 211187                        .IsRequired()
 211188                        .HasMaxLength(256)
 211189                        .HasColumnType("TEXT");
 211190
 211191                    b.Property<string>("DeviceName")
 211192                        .IsRequired()
 211193                        .HasMaxLength(64)
 211194                        .HasColumnType("TEXT");
 211195
 211196                    b.Property<bool>("IsActive")
 211197                        .HasColumnType("INTEGER");
 211198
 211199                    b.Property<Guid>("UserId")
 211200                        .HasColumnType("TEXT");
 211201
 211202                    b.HasKey("Id");
 211203
 211204                    b.HasIndex("DeviceId");
 211205
 211206                    b.HasIndex("AccessToken", "DateLastActivity");
 211207
 211208                    b.HasIndex("DeviceId", "DateLastActivity");
 211209
 211210                    b.HasIndex("UserId", "DeviceId");
 211211
 211212                    b.ToTable("Devices");
 211213
 211214                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211215                });
 1216
 211217            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.DeviceOptions", b =>
 211218                {
 211219                    b.Property<int>("Id")
 211220                        .ValueGeneratedOnAdd()
 211221                        .HasColumnType("INTEGER");
 211222
 211223                    b.Property<string>("CustomName")
 211224                        .HasColumnType("TEXT");
 211225
 211226                    b.Property<string>("DeviceId")
 211227                        .IsRequired()
 211228                        .HasColumnType("TEXT");
 211229
 211230                    b.HasKey("Id");
 211231
 211232                    b.HasIndex("DeviceId")
 211233                        .IsUnique();
 211234
 211235                    b.ToTable("DeviceOptions");
 211236
 211237                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211238                });
 1239
 211240            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.TrickplayInfo", b =>
 211241                {
 211242                    b.Property<Guid>("ItemId")
 211243                        .HasColumnType("TEXT");
 211244
 211245                    b.Property<int>("Width")
 211246                        .HasColumnType("INTEGER");
 211247
 211248                    b.Property<int>("Bandwidth")
 211249                        .HasColumnType("INTEGER");
 211250
 211251                    b.Property<int>("Height")
 211252                        .HasColumnType("INTEGER");
 211253
 211254                    b.Property<int>("Interval")
 211255                        .HasColumnType("INTEGER");
 211256
 211257                    b.Property<int>("ThumbnailCount")
 211258                        .HasColumnType("INTEGER");
 211259
 211260                    b.Property<int>("TileHeight")
 211261                        .HasColumnType("INTEGER");
 211262
 211263                    b.Property<int>("TileWidth")
 211264                        .HasColumnType("INTEGER");
 211265
 211266                    b.HasKey("ItemId", "Width");
 211267
 211268                    b.ToTable("TrickplayInfos");
 211269
 211270                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211271                });
 1272
 211273            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 211274                {
 211275                    b.Property<Guid>("Id")
 211276                        .ValueGeneratedOnAdd()
 211277                        .HasColumnType("TEXT");
 211278
 211279                    b.Property<string>("AudioLanguagePreference")
 211280                        .HasMaxLength(255)
 211281                        .HasColumnType("TEXT");
 211282
 211283                    b.Property<string>("AuthenticationProviderId")
 211284                        .IsRequired()
 211285                        .HasMaxLength(255)
 211286                        .HasColumnType("TEXT");
 211287
 211288                    b.Property<string>("CastReceiverId")
 211289                        .HasMaxLength(32)
 211290                        .HasColumnType("TEXT");
 211291
 211292                    b.Property<bool>("DisplayCollectionsView")
 211293                        .HasColumnType("INTEGER");
 211294
 211295                    b.Property<bool>("DisplayMissingEpisodes")
 211296                        .HasColumnType("INTEGER");
 211297
 211298                    b.Property<bool>("EnableAutoLogin")
 211299                        .HasColumnType("INTEGER");
 211300
 211301                    b.Property<bool>("EnableLocalPassword")
 211302                        .HasColumnType("INTEGER");
 211303
 211304                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 211305                        .HasColumnType("INTEGER");
 211306
 211307                    b.Property<bool>("EnableUserPreferenceAccess")
 211308                        .HasColumnType("INTEGER");
 211309
 211310                    b.Property<bool>("HidePlayedInLatest")
 211311                        .HasColumnType("INTEGER");
 211312
 211313                    b.Property<long>("InternalId")
 211314                        .HasColumnType("INTEGER");
 211315
 211316                    b.Property<int>("InvalidLoginAttemptCount")
 211317                        .HasColumnType("INTEGER");
 211318
 211319                    b.Property<DateTime?>("LastActivityDate")
 211320                        .HasColumnType("TEXT");
 211321
 211322                    b.Property<DateTime?>("LastLoginDate")
 211323                        .HasColumnType("TEXT");
 211324
 211325                    b.Property<int?>("LoginAttemptsBeforeLockout")
 211326                        .HasColumnType("INTEGER");
 211327
 211328                    b.Property<int>("MaxActiveSessions")
 211329                        .HasColumnType("INTEGER");
 211330
 211331                    b.Property<int?>("MaxParentalRatingScore")
 211332                        .HasColumnType("INTEGER");
 211333
 211334                    b.Property<int?>("MaxParentalRatingSubScore")
 211335                        .HasColumnType("INTEGER");
 211336
 211337                    b.Property<bool>("MustUpdatePassword")
 211338                        .HasColumnType("INTEGER");
 211339
 211340                    b.Property<string>("Password")
 211341                        .HasMaxLength(65535)
 211342                        .HasColumnType("TEXT");
 211343
 211344                    b.Property<string>("PasswordResetProviderId")
 211345                        .IsRequired()
 211346                        .HasMaxLength(255)
 211347                        .HasColumnType("TEXT");
 211348
 211349                    b.Property<bool>("PlayDefaultAudioTrack")
 211350                        .HasColumnType("INTEGER");
 211351
 211352                    b.Property<bool>("RememberAudioSelections")
 211353                        .HasColumnType("INTEGER");
 211354
 211355                    b.Property<bool>("RememberSubtitleSelections")
 211356                        .HasColumnType("INTEGER");
 211357
 211358                    b.Property<int?>("RemoteClientBitrateLimit")
 211359                        .HasColumnType("INTEGER");
 211360
 211361                    b.Property<uint>("RowVersion")
 211362                        .IsConcurrencyToken()
 211363                        .HasColumnType("INTEGER");
 211364
 211365                    b.Property<string>("SubtitleLanguagePreference")
 211366                        .HasMaxLength(255)
 211367                        .HasColumnType("TEXT");
 211368
 211369                    b.Property<int>("SubtitleMode")
 211370                        .HasColumnType("INTEGER");
 211371
 211372                    b.Property<int>("SyncPlayAccess")
 211373                        .HasColumnType("INTEGER");
 211374
 211375                    b.Property<string>("Username")
 211376                        .IsRequired()
 211377                        .HasMaxLength(255)
 211378                        .HasColumnType("TEXT");
 211379
 211380                    b.HasKey("Id");
 211381
 211382                    b.HasIndex("Username")
 211383                        .IsUnique();
 211384
 211385                    b.ToTable("Users");
 211386
 211387                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211388                });
 1389
 211390            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 211391                {
 211392                    b.Property<Guid>("ItemId")
 211393                        .HasColumnType("TEXT");
 211394
 211395                    b.Property<Guid>("UserId")
 211396                        .HasColumnType("TEXT");
 211397
 211398                    b.Property<string>("CustomDataKey")
 211399                        .HasColumnType("TEXT");
 211400
 211401                    b.Property<int?>("AudioStreamIndex")
 211402                        .HasColumnType("INTEGER");
 211403
 211404                    b.Property<bool>("IsFavorite")
 211405                        .HasColumnType("INTEGER");
 211406
 211407                    b.Property<DateTime?>("LastPlayedDate")
 211408                        .HasColumnType("TEXT");
 211409
 211410                    b.Property<bool?>("Likes")
 211411                        .HasColumnType("INTEGER");
 211412
 211413                    b.Property<int>("PlayCount")
 211414                        .HasColumnType("INTEGER");
 211415
 211416                    b.Property<long>("PlaybackPositionTicks")
 211417                        .HasColumnType("INTEGER");
 211418
 211419                    b.Property<bool>("Played")
 211420                        .HasColumnType("INTEGER");
 211421
 211422                    b.Property<double?>("Rating")
 211423                        .HasColumnType("REAL");
 211424
 211425                    b.Property<DateTime?>("RetentionDate")
 211426                        .HasColumnType("TEXT");
 211427
 211428                    b.Property<int?>("SubtitleStreamIndex")
 211429                        .HasColumnType("INTEGER");
 211430
 211431                    b.HasKey("ItemId", "UserId", "CustomDataKey");
 211432
 211433                    b.HasIndex("UserId");
 211434
 211435                    b.HasIndex("ItemId", "UserId", "IsFavorite");
 211436
 211437                    b.HasIndex("ItemId", "UserId", "LastPlayedDate");
 211438
 211439                    b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
 211440
 211441                    b.HasIndex("ItemId", "UserId", "Played");
 211442
 211443                    b.ToTable("UserData");
 211444
 211445                    b.HasAnnotation("Sqlite:UseSqlReturningClause", false);
 211446                });
 1447
 211448            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AccessSchedule", b =>
 211449                {
 211450                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 211451                        .WithMany("AccessSchedules")
 211452                        .HasForeignKey("UserId")
 211453                        .OnDelete(DeleteBehavior.Cascade)
 211454                        .IsRequired();
 211455                });
 1456
 211457            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AncestorId", b =>
 211458                {
 211459                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211460                        .WithMany("Parents")
 211461                        .HasForeignKey("ItemId")
 211462                        .OnDelete(DeleteBehavior.Cascade)
 211463                        .IsRequired();
 211464
 211465                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "ParentItem")
 211466                        .WithMany("Children")
 211467                        .HasForeignKey("ParentItemId")
 211468                        .OnDelete(DeleteBehavior.Cascade)
 211469                        .IsRequired();
 211470
 211471                    b.Navigation("Item");
 211472
 211473                    b.Navigation("ParentItem");
 211474                });
 1475
 211476            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.AttachmentStreamInfo", b =>
 211477                {
 211478                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211479                        .WithMany()
 211480                        .HasForeignKey("ItemId")
 211481                        .OnDelete(DeleteBehavior.Cascade)
 211482                        .IsRequired();
 211483
 211484                    b.Navigation("Item");
 211485                });
 1486
 211487            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 211488                {
 211489                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "DirectParent")
 211490                        .WithMany("DirectChildren")
 211491                        .HasForeignKey("ParentId")
 211492                        .OnDelete(DeleteBehavior.Cascade);
 211493
 211494                    b.Navigation("DirectParent");
 211495                });
 1496
 211497            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemImageInfo", b =>
 211498                {
 211499                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211500                        .WithMany("Images")
 211501                        .HasForeignKey("ItemId")
 211502                        .OnDelete(DeleteBehavior.Cascade)
 211503                        .IsRequired();
 211504
 211505                    b.Navigation("Item");
 211506                });
 1507
 211508            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemMetadataField", b =>
 211509                {
 211510                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211511                        .WithMany("LockedFields")
 211512                        .HasForeignKey("ItemId")
 211513                        .OnDelete(DeleteBehavior.Cascade)
 211514                        .IsRequired();
 211515
 211516                    b.Navigation("Item");
 211517                });
 1518
 211519            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemProvider", b =>
 211520                {
 211521                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211522                        .WithMany("Provider")
 211523                        .HasForeignKey("ItemId")
 211524                        .OnDelete(DeleteBehavior.Cascade)
 211525                        .IsRequired();
 211526
 211527                    b.Navigation("Item");
 211528                });
 1529
 211530            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemTrailerType", b =>
 211531                {
 211532                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211533                        .WithMany("TrailerTypes")
 211534                        .HasForeignKey("ItemId")
 211535                        .OnDelete(DeleteBehavior.Cascade)
 211536                        .IsRequired();
 211537
 211538                    b.Navigation("Item");
 211539                });
 1540
 211541            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Chapter", b =>
 211542                {
 211543                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211544                        .WithMany("Chapters")
 211545                        .HasForeignKey("ItemId")
 211546                        .OnDelete(DeleteBehavior.Cascade)
 211547                        .IsRequired();
 211548
 211549                    b.Navigation("Item");
 211550                });
 1551
 211552            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 211553                {
 211554                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 211555                        .WithMany("DisplayPreferences")
 211556                        .HasForeignKey("UserId")
 211557                        .OnDelete(DeleteBehavior.Cascade)
 211558                        .IsRequired();
 211559                });
 1560
 211561            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.HomeSection", b =>
 211562                {
 211563                    b.HasOne("Jellyfin.Database.Implementations.Entities.DisplayPreferences", null)
 211564                        .WithMany("HomeSections")
 211565                        .HasForeignKey("DisplayPreferencesId")
 211566                        .OnDelete(DeleteBehavior.Cascade)
 211567                        .IsRequired();
 211568                });
 1569
 211570            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ImageInfo", b =>
 211571                {
 211572                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 211573                        .WithOne("ProfileImage")
 211574                        .HasForeignKey("Jellyfin.Database.Implementations.Entities.ImageInfo", "UserId")
 211575                        .OnDelete(DeleteBehavior.Cascade);
 211576                });
 1577
 211578            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemDisplayPreferences", b =>
 211579                {
 211580                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 211581                        .WithMany("ItemDisplayPreferences")
 211582                        .HasForeignKey("UserId")
 211583                        .OnDelete(DeleteBehavior.Cascade)
 211584                        .IsRequired();
 211585                });
 1586
 211587            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValueMap", b =>
 211588                {
 211589                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211590                        .WithMany("ItemValues")
 211591                        .HasForeignKey("ItemId")
 211592                        .OnDelete(DeleteBehavior.Cascade)
 211593                        .IsRequired();
 211594
 211595                    b.HasOne("Jellyfin.Database.Implementations.Entities.ItemValue", "ItemValue")
 211596                        .WithMany("BaseItemsMap")
 211597                        .HasForeignKey("ItemValueId")
 211598                        .OnDelete(DeleteBehavior.Cascade)
 211599                        .IsRequired();
 211600
 211601                    b.Navigation("Item");
 211602
 211603                    b.Navigation("ItemValue");
 211604                });
 1605
 211606            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.KeyframeData", b =>
 211607                {
 211608                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211609                        .WithMany()
 211610                        .HasForeignKey("ItemId")
 211611                        .OnDelete(DeleteBehavior.Cascade)
 211612                        .IsRequired();
 211613
 211614                    b.Navigation("Item");
 211615                });
 1616
 211617            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.LinkedChildEntity", b =>
 211618                {
 211619                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Child")
 211620                        .WithMany("LinkedChildOfEntities")
 211621                        .HasForeignKey("ChildId")
 211622                        .OnDelete(DeleteBehavior.NoAction)
 211623                        .IsRequired();
 211624
 211625                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Parent")
 211626                        .WithMany("LinkedChildEntities")
 211627                        .HasForeignKey("ParentId")
 211628                        .OnDelete(DeleteBehavior.NoAction)
 211629                        .IsRequired();
 211630
 211631                    b.Navigation("Child");
 211632
 211633                    b.Navigation("Parent");
 211634                });
 1635
 211636            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.MediaStreamInfo", b =>
 211637                {
 211638                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211639                        .WithMany("MediaStreams")
 211640                        .HasForeignKey("ItemId")
 211641                        .OnDelete(DeleteBehavior.Cascade)
 211642                        .IsRequired();
 211643
 211644                    b.Navigation("Item");
 211645                });
 1646
 211647            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.PeopleBaseItemMap", b =>
 211648                {
 211649                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211650                        .WithMany("Peoples")
 211651                        .HasForeignKey("ItemId")
 211652                        .OnDelete(DeleteBehavior.Cascade)
 211653                        .IsRequired();
 211654
 211655                    b.HasOne("Jellyfin.Database.Implementations.Entities.People", "People")
 211656                        .WithMany("BaseItems")
 211657                        .HasForeignKey("PeopleId")
 211658                        .OnDelete(DeleteBehavior.Cascade)
 211659                        .IsRequired();
 211660
 211661                    b.Navigation("Item");
 211662
 211663                    b.Navigation("People");
 211664                });
 1665
 211666            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Permission", b =>
 211667                {
 211668                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 211669                        .WithMany("Permissions")
 211670                        .HasForeignKey("UserId")
 211671                        .OnDelete(DeleteBehavior.Cascade);
 211672                });
 1673
 211674            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Preference", b =>
 211675                {
 211676                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", null)
 211677                        .WithMany("Preferences")
 211678                        .HasForeignKey("UserId")
 211679                        .OnDelete(DeleteBehavior.Cascade);
 211680                });
 1681
 211682            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.Security.Device", b =>
 211683                {
 211684                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 211685                        .WithMany()
 211686                        .HasForeignKey("UserId")
 211687                        .OnDelete(DeleteBehavior.Cascade)
 211688                        .IsRequired();
 211689
 211690                    b.Navigation("User");
 211691                });
 1692
 211693            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.UserData", b =>
 211694                {
 211695                    b.HasOne("Jellyfin.Database.Implementations.Entities.BaseItemEntity", "Item")
 211696                        .WithMany("UserData")
 211697                        .HasForeignKey("ItemId")
 211698                        .OnDelete(DeleteBehavior.Cascade)
 211699                        .IsRequired();
 211700
 211701                    b.HasOne("Jellyfin.Database.Implementations.Entities.User", "User")
 211702                        .WithMany()
 211703                        .HasForeignKey("UserId")
 211704                        .OnDelete(DeleteBehavior.Cascade)
 211705                        .IsRequired();
 211706
 211707                    b.Navigation("Item");
 211708
 211709                    b.Navigation("User");
 211710                });
 1711
 211712            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.BaseItemEntity", b =>
 211713                {
 211714                    b.Navigation("Chapters");
 211715
 211716                    b.Navigation("Children");
 211717
 211718                    b.Navigation("DirectChildren");
 211719
 211720                    b.Navigation("Images");
 211721
 211722                    b.Navigation("ItemValues");
 211723
 211724                    b.Navigation("LinkedChildEntities");
 211725
 211726                    b.Navigation("LinkedChildOfEntities");
 211727
 211728                    b.Navigation("LockedFields");
 211729
 211730                    b.Navigation("MediaStreams");
 211731
 211732                    b.Navigation("Parents");
 211733
 211734                    b.Navigation("Peoples");
 211735
 211736                    b.Navigation("Provider");
 211737
 211738                    b.Navigation("TrailerTypes");
 211739
 211740                    b.Navigation("UserData");
 211741                });
 1742
 211743            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.DisplayPreferences", b =>
 211744                {
 211745                    b.Navigation("HomeSections");
 211746                });
 1747
 211748            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.ItemValue", b =>
 211749                {
 211750                    b.Navigation("BaseItemsMap");
 211751                });
 1752
 211753            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.People", b =>
 211754                {
 211755                    b.Navigation("BaseItems");
 211756                });
 1757
 211758            modelBuilder.Entity("Jellyfin.Database.Implementations.Entities.User", b =>
 211759                {
 211760                    b.Navigation("AccessSchedules");
 211761
 211762                    b.Navigation("DisplayPreferences");
 211763
 211764                    b.Navigation("ItemDisplayPreferences");
 211765
 211766                    b.Navigation("Permissions");
 211767
 211768                    b.Navigation("Preferences");
 211769
 211770                    b.Navigation("ProfileImage");
 211771                });
 1772#pragma warning restore 612, 618
 211773        }
 1774    }
 1775}