< Summary - Jellyfin

Line coverage
98%
Covered lines: 2062
Uncovered lines: 29
Coverable lines: 2091
Total lines: 2246
Line coverage: 98.6%
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 3/26/2026 - 12:14:14 AM Line coverage: 98.6% (2062/2091) Total lines: 2246

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/20241020103111_LibraryDbMigration.cs

#LineLine coverage
 1using System;
 2using Microsoft.EntityFrameworkCore.Migrations;
 3
 4#nullable disable
 5
 6namespace Jellyfin.Server.Implementations.Migrations
 7{
 8    /// <inheritdoc />
 9    public partial class LibraryDbMigration : Migration
 10    {
 11        /// <inheritdoc />
 12        protected override void Up(MigrationBuilder migrationBuilder)
 13        {
 2214            migrationBuilder.CreateTable(
 2215                name: "BaseItems",
 2216                columns: table => new
 2217                {
 2218                    Id = table.Column<Guid>(type: "TEXT", nullable: false),
 2219                    Type = table.Column<string>(type: "TEXT", nullable: false),
 2220                    Data = table.Column<string>(type: "TEXT", nullable: true),
 2221                    Path = table.Column<string>(type: "TEXT", nullable: true),
 2222                    StartDate = table.Column<DateTime>(type: "TEXT", nullable: false),
 2223                    EndDate = table.Column<DateTime>(type: "TEXT", nullable: false),
 2224                    ChannelId = table.Column<string>(type: "TEXT", nullable: true),
 2225                    IsMovie = table.Column<bool>(type: "INTEGER", nullable: false),
 2226                    CommunityRating = table.Column<float>(type: "REAL", nullable: true),
 2227                    CustomRating = table.Column<string>(type: "TEXT", nullable: true),
 2228                    IndexNumber = table.Column<int>(type: "INTEGER", nullable: true),
 2229                    IsLocked = table.Column<bool>(type: "INTEGER", nullable: false),
 2230                    Name = table.Column<string>(type: "TEXT", nullable: true),
 2231                    OfficialRating = table.Column<string>(type: "TEXT", nullable: true),
 2232                    MediaType = table.Column<string>(type: "TEXT", nullable: true),
 2233                    Overview = table.Column<string>(type: "TEXT", nullable: true),
 2234                    ParentIndexNumber = table.Column<int>(type: "INTEGER", nullable: true),
 2235                    PremiereDate = table.Column<DateTime>(type: "TEXT", nullable: true),
 2236                    ProductionYear = table.Column<int>(type: "INTEGER", nullable: true),
 2237                    Genres = table.Column<string>(type: "TEXT", nullable: true),
 2238                    SortName = table.Column<string>(type: "TEXT", nullable: true),
 2239                    ForcedSortName = table.Column<string>(type: "TEXT", nullable: true),
 2240                    RunTimeTicks = table.Column<long>(type: "INTEGER", nullable: true),
 2241                    DateCreated = table.Column<DateTime>(type: "TEXT", nullable: true),
 2242                    DateModified = table.Column<DateTime>(type: "TEXT", nullable: true),
 2243                    IsSeries = table.Column<bool>(type: "INTEGER", nullable: false),
 2244                    EpisodeTitle = table.Column<string>(type: "TEXT", nullable: true),
 2245                    IsRepeat = table.Column<bool>(type: "INTEGER", nullable: false),
 2246                    PreferredMetadataLanguage = table.Column<string>(type: "TEXT", nullable: true),
 2247                    PreferredMetadataCountryCode = table.Column<string>(type: "TEXT", nullable: true),
 2248                    DateLastRefreshed = table.Column<DateTime>(type: "TEXT", nullable: true),
 2249                    DateLastSaved = table.Column<DateTime>(type: "TEXT", nullable: true),
 2250                    IsInMixedFolder = table.Column<bool>(type: "INTEGER", nullable: false),
 2251                    Studios = table.Column<string>(type: "TEXT", nullable: true),
 2252                    ExternalServiceId = table.Column<string>(type: "TEXT", nullable: true),
 2253                    Tags = table.Column<string>(type: "TEXT", nullable: true),
 2254                    IsFolder = table.Column<bool>(type: "INTEGER", nullable: false),
 2255                    InheritedParentalRatingValue = table.Column<int>(type: "INTEGER", nullable: true),
 2256                    UnratedType = table.Column<string>(type: "TEXT", nullable: true),
 2257                    CriticRating = table.Column<float>(type: "REAL", nullable: true),
 2258                    CleanName = table.Column<string>(type: "TEXT", nullable: true),
 2259                    PresentationUniqueKey = table.Column<string>(type: "TEXT", nullable: true),
 2260                    OriginalTitle = table.Column<string>(type: "TEXT", nullable: true),
 2261                    PrimaryVersionId = table.Column<string>(type: "TEXT", nullable: true),
 2262                    DateLastMediaAdded = table.Column<DateTime>(type: "TEXT", nullable: true),
 2263                    Album = table.Column<string>(type: "TEXT", nullable: true),
 2264                    LUFS = table.Column<float>(type: "REAL", nullable: true),
 2265                    NormalizationGain = table.Column<float>(type: "REAL", nullable: true),
 2266                    IsVirtualItem = table.Column<bool>(type: "INTEGER", nullable: false),
 2267                    SeriesName = table.Column<string>(type: "TEXT", nullable: true),
 2268                    SeasonName = table.Column<string>(type: "TEXT", nullable: true),
 2269                    ExternalSeriesId = table.Column<string>(type: "TEXT", nullable: true),
 2270                    Tagline = table.Column<string>(type: "TEXT", nullable: true),
 2271                    ProductionLocations = table.Column<string>(type: "TEXT", nullable: true),
 2272                    ExtraIds = table.Column<string>(type: "TEXT", nullable: true),
 2273                    TotalBitrate = table.Column<int>(type: "INTEGER", nullable: true),
 2274                    ExtraType = table.Column<int>(type: "INTEGER", nullable: true),
 2275                    Artists = table.Column<string>(type: "TEXT", nullable: true),
 2276                    AlbumArtists = table.Column<string>(type: "TEXT", nullable: true),
 2277                    ExternalId = table.Column<string>(type: "TEXT", nullable: true),
 2278                    SeriesPresentationUniqueKey = table.Column<string>(type: "TEXT", nullable: true),
 2279                    ShowId = table.Column<string>(type: "TEXT", nullable: true),
 2280                    OwnerId = table.Column<string>(type: "TEXT", nullable: true),
 2281                    Width = table.Column<int>(type: "INTEGER", nullable: true),
 2282                    Height = table.Column<int>(type: "INTEGER", nullable: true),
 2283                    Size = table.Column<long>(type: "INTEGER", nullable: true),
 2284                    Audio = table.Column<int>(type: "INTEGER", nullable: true),
 2285                    ParentId = table.Column<Guid>(type: "TEXT", nullable: true),
 2286                    TopParentId = table.Column<Guid>(type: "TEXT", nullable: true),
 2287                    SeasonId = table.Column<Guid>(type: "TEXT", nullable: true),
 2288                    SeriesId = table.Column<Guid>(type: "TEXT", nullable: true)
 2289                },
 2290                constraints: table =>
 2291                {
 2292                    table.PrimaryKey("PK_BaseItems", x => x.Id);
 2293                });
 94
 2295            migrationBuilder.CreateTable(
 2296                name: "ItemValues",
 2297                columns: table => new
 2298                {
 2299                    ItemValueId = table.Column<Guid>(type: "TEXT", nullable: false),
 22100                    Type = table.Column<int>(type: "INTEGER", nullable: false),
 22101                    Value = table.Column<string>(type: "TEXT", nullable: false),
 22102                    CleanValue = table.Column<string>(type: "TEXT", nullable: false)
 22103                },
 22104                constraints: table =>
 22105                {
 22106                    table.PrimaryKey("PK_ItemValues", x => x.ItemValueId);
 22107                });
 108
 22109            migrationBuilder.CreateTable(
 22110                name: "Peoples",
 22111                columns: table => new
 22112                {
 22113                    Id = table.Column<Guid>(type: "TEXT", nullable: false),
 22114                    Name = table.Column<string>(type: "TEXT", nullable: false),
 22115                    PersonType = table.Column<string>(type: "TEXT", nullable: true)
 22116                },
 22117                constraints: table =>
 22118                {
 22119                    table.PrimaryKey("PK_Peoples", x => x.Id);
 22120                });
 121
 22122            migrationBuilder.CreateTable(
 22123                name: "AncestorIds",
 22124                columns: table => new
 22125                {
 22126                    ParentItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22127                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22128                    BaseItemEntityId = table.Column<Guid>(type: "TEXT", nullable: true)
 22129                },
 22130                constraints: table =>
 22131                {
 22132                    table.PrimaryKey("PK_AncestorIds", x => new { x.ItemId, x.ParentItemId });
 22133                    table.ForeignKey(
 22134                        name: "FK_AncestorIds_BaseItems_BaseItemEntityId",
 22135                        column: x => x.BaseItemEntityId,
 22136                        principalTable: "BaseItems",
 22137                        principalColumn: "Id");
 22138                    table.ForeignKey(
 22139                        name: "FK_AncestorIds_BaseItems_ItemId",
 22140                        column: x => x.ItemId,
 22141                        principalTable: "BaseItems",
 22142                        principalColumn: "Id",
 22143                        onDelete: ReferentialAction.Cascade);
 22144                    table.ForeignKey(
 22145                        name: "FK_AncestorIds_BaseItems_ParentItemId",
 22146                        column: x => x.ParentItemId,
 22147                        principalTable: "BaseItems",
 22148                        principalColumn: "Id",
 22149                        onDelete: ReferentialAction.Cascade);
 22150                });
 151
 22152            migrationBuilder.CreateTable(
 22153                name: "AttachmentStreamInfos",
 22154                columns: table => new
 22155                {
 22156                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22157                    Index = table.Column<int>(type: "INTEGER", nullable: false),
 22158                    Codec = table.Column<string>(type: "TEXT", nullable: false),
 22159                    CodecTag = table.Column<string>(type: "TEXT", nullable: true),
 22160                    Comment = table.Column<string>(type: "TEXT", nullable: true),
 22161                    Filename = table.Column<string>(type: "TEXT", nullable: true),
 22162                    MimeType = table.Column<string>(type: "TEXT", nullable: true)
 22163                },
 22164                constraints: table =>
 22165                {
 22166                    table.PrimaryKey("PK_AttachmentStreamInfos", x => new { x.ItemId, x.Index });
 22167                    table.ForeignKey(
 22168                        name: "FK_AttachmentStreamInfos_BaseItems_ItemId",
 22169                        column: x => x.ItemId,
 22170                        principalTable: "BaseItems",
 22171                        principalColumn: "Id",
 22172                        onDelete: ReferentialAction.Cascade);
 22173                });
 174
 22175            migrationBuilder.CreateTable(
 22176                name: "BaseItemImageInfos",
 22177                columns: table => new
 22178                {
 22179                    Id = table.Column<Guid>(type: "TEXT", nullable: false),
 22180                    Path = table.Column<string>(type: "TEXT", nullable: false),
 22181                    DateModified = table.Column<DateTime>(type: "TEXT", nullable: false),
 22182                    ImageType = table.Column<int>(type: "INTEGER", nullable: false),
 22183                    Width = table.Column<int>(type: "INTEGER", nullable: false),
 22184                    Height = table.Column<int>(type: "INTEGER", nullable: false),
 22185                    Blurhash = table.Column<byte[]>(type: "BLOB", nullable: true),
 22186                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false)
 22187                },
 22188                constraints: table =>
 22189                {
 22190                    table.PrimaryKey("PK_BaseItemImageInfos", x => x.Id);
 22191                    table.ForeignKey(
 22192                        name: "FK_BaseItemImageInfos_BaseItems_ItemId",
 22193                        column: x => x.ItemId,
 22194                        principalTable: "BaseItems",
 22195                        principalColumn: "Id",
 22196                        onDelete: ReferentialAction.Cascade);
 22197                });
 198
 22199            migrationBuilder.CreateTable(
 22200                name: "BaseItemMetadataFields",
 22201                columns: table => new
 22202                {
 22203                    Id = table.Column<int>(type: "INTEGER", nullable: false),
 22204                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false)
 22205                },
 22206                constraints: table =>
 22207                {
 22208                    table.PrimaryKey("PK_BaseItemMetadataFields", x => new { x.Id, x.ItemId });
 22209                    table.ForeignKey(
 22210                        name: "FK_BaseItemMetadataFields_BaseItems_ItemId",
 22211                        column: x => x.ItemId,
 22212                        principalTable: "BaseItems",
 22213                        principalColumn: "Id",
 22214                        onDelete: ReferentialAction.Cascade);
 22215                });
 216
 22217            migrationBuilder.CreateTable(
 22218                name: "BaseItemProviders",
 22219                columns: table => new
 22220                {
 22221                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22222                    ProviderId = table.Column<string>(type: "TEXT", nullable: false),
 22223                    ProviderValue = table.Column<string>(type: "TEXT", nullable: false)
 22224                },
 22225                constraints: table =>
 22226                {
 22227                    table.PrimaryKey("PK_BaseItemProviders", x => new { x.ItemId, x.ProviderId });
 22228                    table.ForeignKey(
 22229                        name: "FK_BaseItemProviders_BaseItems_ItemId",
 22230                        column: x => x.ItemId,
 22231                        principalTable: "BaseItems",
 22232                        principalColumn: "Id",
 22233                        onDelete: ReferentialAction.Cascade);
 22234                });
 235
 22236            migrationBuilder.CreateTable(
 22237                name: "BaseItemTrailerTypes",
 22238                columns: table => new
 22239                {
 22240                    Id = table.Column<int>(type: "INTEGER", nullable: false),
 22241                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false)
 22242                },
 22243                constraints: table =>
 22244                {
 22245                    table.PrimaryKey("PK_BaseItemTrailerTypes", x => new { x.Id, x.ItemId });
 22246                    table.ForeignKey(
 22247                        name: "FK_BaseItemTrailerTypes_BaseItems_ItemId",
 22248                        column: x => x.ItemId,
 22249                        principalTable: "BaseItems",
 22250                        principalColumn: "Id",
 22251                        onDelete: ReferentialAction.Cascade);
 22252                });
 253
 22254            migrationBuilder.CreateTable(
 22255                name: "Chapters",
 22256                columns: table => new
 22257                {
 22258                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22259                    ChapterIndex = table.Column<int>(type: "INTEGER", nullable: false),
 22260                    StartPositionTicks = table.Column<long>(type: "INTEGER", nullable: false),
 22261                    Name = table.Column<string>(type: "TEXT", nullable: true),
 22262                    ImagePath = table.Column<string>(type: "TEXT", nullable: true),
 22263                    ImageDateModified = table.Column<DateTime>(type: "TEXT", nullable: true)
 22264                },
 22265                constraints: table =>
 22266                {
 22267                    table.PrimaryKey("PK_Chapters", x => new { x.ItemId, x.ChapterIndex });
 22268                    table.ForeignKey(
 22269                        name: "FK_Chapters_BaseItems_ItemId",
 22270                        column: x => x.ItemId,
 22271                        principalTable: "BaseItems",
 22272                        principalColumn: "Id",
 22273                        onDelete: ReferentialAction.Cascade);
 22274                });
 275
 22276            migrationBuilder.CreateTable(
 22277                name: "MediaStreamInfos",
 22278                columns: table => new
 22279                {
 22280                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22281                    StreamIndex = table.Column<int>(type: "INTEGER", nullable: false),
 22282                    StreamType = table.Column<int>(type: "INTEGER", nullable: true),
 22283                    Codec = table.Column<string>(type: "TEXT", nullable: true),
 22284                    Language = table.Column<string>(type: "TEXT", nullable: true),
 22285                    ChannelLayout = table.Column<string>(type: "TEXT", nullable: true),
 22286                    Profile = table.Column<string>(type: "TEXT", nullable: true),
 22287                    AspectRatio = table.Column<string>(type: "TEXT", nullable: true),
 22288                    Path = table.Column<string>(type: "TEXT", nullable: true),
 22289                    IsInterlaced = table.Column<bool>(type: "INTEGER", nullable: false),
 22290                    BitRate = table.Column<int>(type: "INTEGER", nullable: false),
 22291                    Channels = table.Column<int>(type: "INTEGER", nullable: false),
 22292                    SampleRate = table.Column<int>(type: "INTEGER", nullable: false),
 22293                    IsDefault = table.Column<bool>(type: "INTEGER", nullable: false),
 22294                    IsForced = table.Column<bool>(type: "INTEGER", nullable: false),
 22295                    IsExternal = table.Column<bool>(type: "INTEGER", nullable: false),
 22296                    Height = table.Column<int>(type: "INTEGER", nullable: false),
 22297                    Width = table.Column<int>(type: "INTEGER", nullable: false),
 22298                    AverageFrameRate = table.Column<float>(type: "REAL", nullable: false),
 22299                    RealFrameRate = table.Column<float>(type: "REAL", nullable: false),
 22300                    Level = table.Column<float>(type: "REAL", nullable: false),
 22301                    PixelFormat = table.Column<string>(type: "TEXT", nullable: true),
 22302                    BitDepth = table.Column<int>(type: "INTEGER", nullable: false),
 22303                    IsAnamorphic = table.Column<bool>(type: "INTEGER", nullable: false),
 22304                    RefFrames = table.Column<int>(type: "INTEGER", nullable: false),
 22305                    CodecTag = table.Column<string>(type: "TEXT", nullable: false),
 22306                    Comment = table.Column<string>(type: "TEXT", nullable: false),
 22307                    NalLengthSize = table.Column<string>(type: "TEXT", nullable: false),
 22308                    IsAvc = table.Column<bool>(type: "INTEGER", nullable: false),
 22309                    Title = table.Column<string>(type: "TEXT", nullable: false),
 22310                    TimeBase = table.Column<string>(type: "TEXT", nullable: false),
 22311                    CodecTimeBase = table.Column<string>(type: "TEXT", nullable: false),
 22312                    ColorPrimaries = table.Column<string>(type: "TEXT", nullable: false),
 22313                    ColorSpace = table.Column<string>(type: "TEXT", nullable: false),
 22314                    ColorTransfer = table.Column<string>(type: "TEXT", nullable: false),
 22315                    DvVersionMajor = table.Column<int>(type: "INTEGER", nullable: false),
 22316                    DvVersionMinor = table.Column<int>(type: "INTEGER", nullable: false),
 22317                    DvProfile = table.Column<int>(type: "INTEGER", nullable: false),
 22318                    DvLevel = table.Column<int>(type: "INTEGER", nullable: false),
 22319                    RpuPresentFlag = table.Column<int>(type: "INTEGER", nullable: false),
 22320                    ElPresentFlag = table.Column<int>(type: "INTEGER", nullable: false),
 22321                    BlPresentFlag = table.Column<int>(type: "INTEGER", nullable: false),
 22322                    DvBlSignalCompatibilityId = table.Column<int>(type: "INTEGER", nullable: false),
 22323                    IsHearingImpaired = table.Column<bool>(type: "INTEGER", nullable: false),
 22324                    Rotation = table.Column<int>(type: "INTEGER", nullable: false),
 22325                    KeyFrames = table.Column<string>(type: "TEXT", nullable: true)
 22326                },
 22327                constraints: table =>
 22328                {
 22329                    table.PrimaryKey("PK_MediaStreamInfos", x => new { x.ItemId, x.StreamIndex });
 22330                    table.ForeignKey(
 22331                        name: "FK_MediaStreamInfos_BaseItems_ItemId",
 22332                        column: x => x.ItemId,
 22333                        principalTable: "BaseItems",
 22334                        principalColumn: "Id",
 22335                        onDelete: ReferentialAction.Cascade);
 22336                });
 337
 22338            migrationBuilder.CreateTable(
 22339                name: "UserData",
 22340                columns: table => new
 22341                {
 22342                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22343                    UserId = table.Column<Guid>(type: "TEXT", nullable: false),
 22344                    Rating = table.Column<double>(type: "REAL", nullable: true),
 22345                    PlaybackPositionTicks = table.Column<long>(type: "INTEGER", nullable: false),
 22346                    PlayCount = table.Column<int>(type: "INTEGER", nullable: false),
 22347                    IsFavorite = table.Column<bool>(type: "INTEGER", nullable: false),
 22348                    LastPlayedDate = table.Column<DateTime>(type: "TEXT", nullable: true),
 22349                    Played = table.Column<bool>(type: "INTEGER", nullable: false),
 22350                    AudioStreamIndex = table.Column<int>(type: "INTEGER", nullable: true),
 22351                    SubtitleStreamIndex = table.Column<int>(type: "INTEGER", nullable: true),
 22352                    Likes = table.Column<bool>(type: "INTEGER", nullable: true)
 22353                },
 22354                constraints: table =>
 22355                {
 22356                    table.PrimaryKey("PK_UserData", x => new { x.ItemId, x.UserId });
 22357                    table.ForeignKey(
 22358                        name: "FK_UserData_BaseItems_ItemId",
 22359                        column: x => x.ItemId,
 22360                        principalTable: "BaseItems",
 22361                        principalColumn: "Id",
 22362                        onDelete: ReferentialAction.Cascade);
 22363                    table.ForeignKey(
 22364                        name: "FK_UserData_Users_UserId",
 22365                        column: x => x.UserId,
 22366                        principalTable: "Users",
 22367                        principalColumn: "Id",
 22368                        onDelete: ReferentialAction.Cascade);
 22369                });
 370
 22371            migrationBuilder.CreateTable(
 22372                name: "ItemValuesMap",
 22373                columns: table => new
 22374                {
 22375                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22376                    ItemValueId = table.Column<Guid>(type: "TEXT", nullable: false)
 22377                },
 22378                constraints: table =>
 22379                {
 22380                    table.PrimaryKey("PK_ItemValuesMap", x => new { x.ItemValueId, x.ItemId });
 22381                    table.ForeignKey(
 22382                        name: "FK_ItemValuesMap_BaseItems_ItemId",
 22383                        column: x => x.ItemId,
 22384                        principalTable: "BaseItems",
 22385                        principalColumn: "Id",
 22386                        onDelete: ReferentialAction.Cascade);
 22387                    table.ForeignKey(
 22388                        name: "FK_ItemValuesMap_ItemValues_ItemValueId",
 22389                        column: x => x.ItemValueId,
 22390                        principalTable: "ItemValues",
 22391                        principalColumn: "ItemValueId",
 22392                        onDelete: ReferentialAction.Cascade);
 22393                });
 394
 22395            migrationBuilder.CreateTable(
 22396                name: "PeopleBaseItemMap",
 22397                columns: table => new
 22398                {
 22399                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 22400                    PeopleId = table.Column<Guid>(type: "TEXT", nullable: false),
 22401                    SortOrder = table.Column<int>(type: "INTEGER", nullable: true),
 22402                    ListOrder = table.Column<int>(type: "INTEGER", nullable: true),
 22403                    Role = table.Column<string>(type: "TEXT", nullable: true)
 22404                },
 22405                constraints: table =>
 22406                {
 22407                    table.PrimaryKey("PK_PeopleBaseItemMap", x => new { x.ItemId, x.PeopleId });
 22408                    table.ForeignKey(
 22409                        name: "FK_PeopleBaseItemMap_BaseItems_ItemId",
 22410                        column: x => x.ItemId,
 22411                        principalTable: "BaseItems",
 22412                        principalColumn: "Id",
 22413                        onDelete: ReferentialAction.Cascade);
 22414                    table.ForeignKey(
 22415                        name: "FK_PeopleBaseItemMap_Peoples_PeopleId",
 22416                        column: x => x.PeopleId,
 22417                        principalTable: "Peoples",
 22418                        principalColumn: "Id",
 22419                        onDelete: ReferentialAction.Cascade);
 22420                });
 421
 22422            migrationBuilder.CreateIndex(
 22423                name: "IX_AncestorIds_BaseItemEntityId",
 22424                table: "AncestorIds",
 22425                column: "BaseItemEntityId");
 426
 22427            migrationBuilder.CreateIndex(
 22428                name: "IX_AncestorIds_ParentItemId",
 22429                table: "AncestorIds",
 22430                column: "ParentItemId");
 431
 22432            migrationBuilder.CreateIndex(
 22433                name: "IX_BaseItemImageInfos_ItemId",
 22434                table: "BaseItemImageInfos",
 22435                column: "ItemId");
 436
 22437            migrationBuilder.CreateIndex(
 22438                name: "IX_BaseItemMetadataFields_ItemId",
 22439                table: "BaseItemMetadataFields",
 22440                column: "ItemId");
 441
 22442            migrationBuilder.CreateIndex(
 22443                name: "IX_BaseItemProviders_ProviderId_ProviderValue_ItemId",
 22444                table: "BaseItemProviders",
 22445                columns: new[] { "ProviderId", "ProviderValue", "ItemId" });
 446
 22447            migrationBuilder.CreateIndex(
 22448                name: "IX_BaseItems_Id_Type_IsFolder_IsVirtualItem",
 22449                table: "BaseItems",
 22450                columns: new[] { "Id", "Type", "IsFolder", "IsVirtualItem" });
 451
 22452            migrationBuilder.CreateIndex(
 22453                name: "IX_BaseItems_IsFolder_TopParentId_IsVirtualItem_PresentationUniqueKey_DateCreated",
 22454                table: "BaseItems",
 22455                columns: new[] { "IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated" });
 456
 22457            migrationBuilder.CreateIndex(
 22458                name: "IX_BaseItems_MediaType_TopParentId_IsVirtualItem_PresentationUniqueKey",
 22459                table: "BaseItems",
 22460                columns: new[] { "MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey" });
 461
 22462            migrationBuilder.CreateIndex(
 22463                name: "IX_BaseItems_ParentId",
 22464                table: "BaseItems",
 22465                column: "ParentId");
 466
 22467            migrationBuilder.CreateIndex(
 22468                name: "IX_BaseItems_Path",
 22469                table: "BaseItems",
 22470                column: "Path");
 471
 22472            migrationBuilder.CreateIndex(
 22473                name: "IX_BaseItems_PresentationUniqueKey",
 22474                table: "BaseItems",
 22475                column: "PresentationUniqueKey");
 476
 22477            migrationBuilder.CreateIndex(
 22478                name: "IX_BaseItems_TopParentId_Id",
 22479                table: "BaseItems",
 22480                columns: new[] { "TopParentId", "Id" });
 481
 22482            migrationBuilder.CreateIndex(
 22483                name: "IX_BaseItems_Type_SeriesPresentationUniqueKey_IsFolder_IsVirtualItem",
 22484                table: "BaseItems",
 22485                columns: new[] { "Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem" });
 486
 22487            migrationBuilder.CreateIndex(
 22488                name: "IX_BaseItems_Type_SeriesPresentationUniqueKey_PresentationUniqueKey_SortName",
 22489                table: "BaseItems",
 22490                columns: new[] { "Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName" });
 491
 22492            migrationBuilder.CreateIndex(
 22493                name: "IX_BaseItems_Type_TopParentId_Id",
 22494                table: "BaseItems",
 22495                columns: new[] { "Type", "TopParentId", "Id" });
 496
 22497            migrationBuilder.CreateIndex(
 22498                name: "IX_BaseItems_Type_TopParentId_IsVirtualItem_PresentationUniqueKey_DateCreated",
 22499                table: "BaseItems",
 22500                columns: new[] { "Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated" });
 501
 22502            migrationBuilder.CreateIndex(
 22503                name: "IX_BaseItems_Type_TopParentId_PresentationUniqueKey",
 22504                table: "BaseItems",
 22505                columns: new[] { "Type", "TopParentId", "PresentationUniqueKey" });
 506
 22507            migrationBuilder.CreateIndex(
 22508                name: "IX_BaseItems_Type_TopParentId_StartDate",
 22509                table: "BaseItems",
 22510                columns: new[] { "Type", "TopParentId", "StartDate" });
 511
 22512            migrationBuilder.CreateIndex(
 22513                name: "IX_BaseItemTrailerTypes_ItemId",
 22514                table: "BaseItemTrailerTypes",
 22515                column: "ItemId");
 516
 22517            migrationBuilder.CreateIndex(
 22518                name: "IX_ItemValues_Type_CleanValue",
 22519                table: "ItemValues",
 22520                columns: new[] { "Type", "CleanValue" });
 521
 22522            migrationBuilder.CreateIndex(
 22523                name: "IX_ItemValuesMap_ItemId",
 22524                table: "ItemValuesMap",
 22525                column: "ItemId");
 526
 22527            migrationBuilder.CreateIndex(
 22528                name: "IX_MediaStreamInfos_StreamIndex",
 22529                table: "MediaStreamInfos",
 22530                column: "StreamIndex");
 531
 22532            migrationBuilder.CreateIndex(
 22533                name: "IX_MediaStreamInfos_StreamIndex_StreamType",
 22534                table: "MediaStreamInfos",
 22535                columns: new[] { "StreamIndex", "StreamType" });
 536
 22537            migrationBuilder.CreateIndex(
 22538                name: "IX_MediaStreamInfos_StreamIndex_StreamType_Language",
 22539                table: "MediaStreamInfos",
 22540                columns: new[] { "StreamIndex", "StreamType", "Language" });
 541
 22542            migrationBuilder.CreateIndex(
 22543                name: "IX_MediaStreamInfos_StreamType",
 22544                table: "MediaStreamInfos",
 22545                column: "StreamType");
 546
 22547            migrationBuilder.CreateIndex(
 22548                name: "IX_PeopleBaseItemMap_ItemId_ListOrder",
 22549                table: "PeopleBaseItemMap",
 22550                columns: new[] { "ItemId", "ListOrder" });
 551
 22552            migrationBuilder.CreateIndex(
 22553                name: "IX_PeopleBaseItemMap_ItemId_SortOrder",
 22554                table: "PeopleBaseItemMap",
 22555                columns: new[] { "ItemId", "SortOrder" });
 556
 22557            migrationBuilder.CreateIndex(
 22558                name: "IX_PeopleBaseItemMap_PeopleId",
 22559                table: "PeopleBaseItemMap",
 22560                column: "PeopleId");
 561
 22562            migrationBuilder.CreateIndex(
 22563                name: "IX_Peoples_Name",
 22564                table: "Peoples",
 22565                column: "Name");
 566
 22567            migrationBuilder.CreateIndex(
 22568                name: "IX_UserData_ItemId_UserId_IsFavorite",
 22569                table: "UserData",
 22570                columns: new[] { "ItemId", "UserId", "IsFavorite" });
 571
 22572            migrationBuilder.CreateIndex(
 22573                name: "IX_UserData_ItemId_UserId_LastPlayedDate",
 22574                table: "UserData",
 22575                columns: new[] { "ItemId", "UserId", "LastPlayedDate" });
 576
 22577            migrationBuilder.CreateIndex(
 22578                name: "IX_UserData_ItemId_UserId_PlaybackPositionTicks",
 22579                table: "UserData",
 22580                columns: new[] { "ItemId", "UserId", "PlaybackPositionTicks" });
 581
 22582            migrationBuilder.CreateIndex(
 22583                name: "IX_UserData_ItemId_UserId_Played",
 22584                table: "UserData",
 22585                columns: new[] { "ItemId", "UserId", "Played" });
 586
 22587            migrationBuilder.CreateIndex(
 22588                name: "IX_UserData_UserId",
 22589                table: "UserData",
 22590                column: "UserId");
 22591        }
 592
 593        /// <inheritdoc />
 594        protected override void Down(MigrationBuilder migrationBuilder)
 595        {
 0596            migrationBuilder.DropTable(
 0597                name: "AncestorIds");
 598
 0599            migrationBuilder.DropTable(
 0600                name: "AttachmentStreamInfos");
 601
 0602            migrationBuilder.DropTable(
 0603                name: "BaseItemImageInfos");
 604
 0605            migrationBuilder.DropTable(
 0606                name: "BaseItemMetadataFields");
 607
 0608            migrationBuilder.DropTable(
 0609                name: "BaseItemProviders");
 610
 0611            migrationBuilder.DropTable(
 0612                name: "BaseItemTrailerTypes");
 613
 0614            migrationBuilder.DropTable(
 0615                name: "Chapters");
 616
 0617            migrationBuilder.DropTable(
 0618                name: "ItemValuesMap");
 619
 0620            migrationBuilder.DropTable(
 0621                name: "MediaStreamInfos");
 622
 0623            migrationBuilder.DropTable(
 0624                name: "PeopleBaseItemMap");
 625
 0626            migrationBuilder.DropTable(
 0627                name: "UserData");
 628
 0629            migrationBuilder.DropTable(
 0630                name: "ItemValues");
 631
 0632            migrationBuilder.DropTable(
 0633                name: "Peoples");
 634
 0635            migrationBuilder.DropTable(
 0636                name: "BaseItems");
 0637        }
 638    }
 639}

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20241020103111_LibraryDbMigration.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.Server.Implementations.Migrations
 12{
 13    [DbContext(typeof(JellyfinDbContext))]
 14    [Migration("20241020103111_LibraryDbMigration")]
 15    partial class LibraryDbMigration
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 2221            modelBuilder.HasAnnotation("ProductVersion", "8.0.10");
 22
 2223            modelBuilder.Entity("Jellyfin.Data.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                });
 47
 2248            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
 2249                {
 2250                    b.Property<int>("Id")
 2251                        .ValueGeneratedOnAdd()
 2252                        .HasColumnType("INTEGER");
 2253
 2254                    b.Property<DateTime>("DateCreated")
 2255                        .HasColumnType("TEXT");
 2256
 2257                    b.Property<string>("ItemId")
 2258                        .HasMaxLength(256)
 2259                        .HasColumnType("TEXT");
 2260
 2261                    b.Property<int>("LogSeverity")
 2262                        .HasColumnType("INTEGER");
 2263
 2264                    b.Property<string>("Name")
 2265                        .IsRequired()
 2266                        .HasMaxLength(512)
 2267                        .HasColumnType("TEXT");
 2268
 2269                    b.Property<string>("Overview")
 2270                        .HasMaxLength(512)
 2271                        .HasColumnType("TEXT");
 2272
 2273                    b.Property<uint>("RowVersion")
 2274                        .IsConcurrencyToken()
 2275                        .HasColumnType("INTEGER");
 2276
 2277                    b.Property<string>("ShortOverview")
 2278                        .HasMaxLength(512)
 2279                        .HasColumnType("TEXT");
 2280
 2281                    b.Property<string>("Type")
 2282                        .IsRequired()
 2283                        .HasMaxLength(256)
 2284                        .HasColumnType("TEXT");
 2285
 2286                    b.Property<Guid>("UserId")
 2287                        .HasColumnType("TEXT");
 2288
 2289                    b.HasKey("Id");
 2290
 2291                    b.HasIndex("DateCreated");
 2292
 2293                    b.ToTable("ActivityLogs");
 2294                });
 95
 2296            modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b =>
 2297                {
 2298                    b.Property<Guid>("ItemId")
 2299                        .HasColumnType("TEXT");
 22100
 22101                    b.Property<Guid>("ParentItemId")
 22102                        .HasColumnType("TEXT");
 22103
 22104                    b.Property<Guid?>("BaseItemEntityId")
 22105                        .HasColumnType("TEXT");
 22106
 22107                    b.HasKey("ItemId", "ParentItemId");
 22108
 22109                    b.HasIndex("BaseItemEntityId");
 22110
 22111                    b.HasIndex("ParentItemId");
 22112
 22113                    b.ToTable("AncestorIds");
 22114                });
 115
 22116            modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b =>
 22117                {
 22118                    b.Property<Guid>("ItemId")
 22119                        .HasColumnType("TEXT");
 22120
 22121                    b.Property<int>("Index")
 22122                        .HasColumnType("INTEGER");
 22123
 22124                    b.Property<string>("Codec")
 22125                        .IsRequired()
 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                });
 144
 22145            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b =>
 22146                {
 22147                    b.Property<Guid>("Id")
 22148                        .ValueGeneratedOnAdd()
 22149                        .HasColumnType("TEXT");
 22150
 22151                    b.Property<string>("Album")
 22152                        .HasColumnType("TEXT");
 22153
 22154                    b.Property<string>("AlbumArtists")
 22155                        .HasColumnType("TEXT");
 22156
 22157                    b.Property<string>("Artists")
 22158                        .HasColumnType("TEXT");
 22159
 22160                    b.Property<int?>("Audio")
 22161                        .HasColumnType("INTEGER");
 22162
 22163                    b.Property<string>("ChannelId")
 22164                        .HasColumnType("TEXT");
 22165
 22166                    b.Property<string>("CleanName")
 22167                        .HasColumnType("TEXT");
 22168
 22169                    b.Property<float?>("CommunityRating")
 22170                        .HasColumnType("REAL");
 22171
 22172                    b.Property<float?>("CriticRating")
 22173                        .HasColumnType("REAL");
 22174
 22175                    b.Property<string>("CustomRating")
 22176                        .HasColumnType("TEXT");
 22177
 22178                    b.Property<string>("Data")
 22179                        .HasColumnType("TEXT");
 22180
 22181                    b.Property<DateTime?>("DateCreated")
 22182                        .HasColumnType("TEXT");
 22183
 22184                    b.Property<DateTime?>("DateLastMediaAdded")
 22185                        .HasColumnType("TEXT");
 22186
 22187                    b.Property<DateTime?>("DateLastRefreshed")
 22188                        .HasColumnType("TEXT");
 22189
 22190                    b.Property<DateTime?>("DateLastSaved")
 22191                        .HasColumnType("TEXT");
 22192
 22193                    b.Property<DateTime?>("DateModified")
 22194                        .HasColumnType("TEXT");
 22195
 22196                    b.Property<DateTime>("EndDate")
 22197                        .HasColumnType("TEXT");
 22198
 22199                    b.Property<string>("EpisodeTitle")
 22200                        .HasColumnType("TEXT");
 22201
 22202                    b.Property<string>("ExternalId")
 22203                        .HasColumnType("TEXT");
 22204
 22205                    b.Property<string>("ExternalSeriesId")
 22206                        .HasColumnType("TEXT");
 22207
 22208                    b.Property<string>("ExternalServiceId")
 22209                        .HasColumnType("TEXT");
 22210
 22211                    b.Property<string>("ExtraIds")
 22212                        .HasColumnType("TEXT");
 22213
 22214                    b.Property<int?>("ExtraType")
 22215                        .HasColumnType("INTEGER");
 22216
 22217                    b.Property<string>("ForcedSortName")
 22218                        .HasColumnType("TEXT");
 22219
 22220                    b.Property<string>("Genres")
 22221                        .HasColumnType("TEXT");
 22222
 22223                    b.Property<int?>("Height")
 22224                        .HasColumnType("INTEGER");
 22225
 22226                    b.Property<int?>("IndexNumber")
 22227                        .HasColumnType("INTEGER");
 22228
 22229                    b.Property<int?>("InheritedParentalRatingValue")
 22230                        .HasColumnType("INTEGER");
 22231
 22232                    b.Property<bool>("IsFolder")
 22233                        .HasColumnType("INTEGER");
 22234
 22235                    b.Property<bool>("IsInMixedFolder")
 22236                        .HasColumnType("INTEGER");
 22237
 22238                    b.Property<bool>("IsLocked")
 22239                        .HasColumnType("INTEGER");
 22240
 22241                    b.Property<bool>("IsMovie")
 22242                        .HasColumnType("INTEGER");
 22243
 22244                    b.Property<bool>("IsRepeat")
 22245                        .HasColumnType("INTEGER");
 22246
 22247                    b.Property<bool>("IsSeries")
 22248                        .HasColumnType("INTEGER");
 22249
 22250                    b.Property<bool>("IsVirtualItem")
 22251                        .HasColumnType("INTEGER");
 22252
 22253                    b.Property<float?>("LUFS")
 22254                        .HasColumnType("REAL");
 22255
 22256                    b.Property<string>("MediaType")
 22257                        .HasColumnType("TEXT");
 22258
 22259                    b.Property<string>("Name")
 22260                        .HasColumnType("TEXT");
 22261
 22262                    b.Property<float?>("NormalizationGain")
 22263                        .HasColumnType("REAL");
 22264
 22265                    b.Property<string>("OfficialRating")
 22266                        .HasColumnType("TEXT");
 22267
 22268                    b.Property<string>("OriginalTitle")
 22269                        .HasColumnType("TEXT");
 22270
 22271                    b.Property<string>("Overview")
 22272                        .HasColumnType("TEXT");
 22273
 22274                    b.Property<string>("OwnerId")
 22275                        .HasColumnType("TEXT");
 22276
 22277                    b.Property<Guid?>("ParentId")
 22278                        .HasColumnType("TEXT");
 22279
 22280                    b.Property<int?>("ParentIndexNumber")
 22281                        .HasColumnType("INTEGER");
 22282
 22283                    b.Property<string>("Path")
 22284                        .HasColumnType("TEXT");
 22285
 22286                    b.Property<string>("PreferredMetadataCountryCode")
 22287                        .HasColumnType("TEXT");
 22288
 22289                    b.Property<string>("PreferredMetadataLanguage")
 22290                        .HasColumnType("TEXT");
 22291
 22292                    b.Property<DateTime?>("PremiereDate")
 22293                        .HasColumnType("TEXT");
 22294
 22295                    b.Property<string>("PresentationUniqueKey")
 22296                        .HasColumnType("TEXT");
 22297
 22298                    b.Property<string>("PrimaryVersionId")
 22299                        .HasColumnType("TEXT");
 22300
 22301                    b.Property<string>("ProductionLocations")
 22302                        .HasColumnType("TEXT");
 22303
 22304                    b.Property<int?>("ProductionYear")
 22305                        .HasColumnType("INTEGER");
 22306
 22307                    b.Property<long?>("RunTimeTicks")
 22308                        .HasColumnType("INTEGER");
 22309
 22310                    b.Property<Guid?>("SeasonId")
 22311                        .HasColumnType("TEXT");
 22312
 22313                    b.Property<string>("SeasonName")
 22314                        .HasColumnType("TEXT");
 22315
 22316                    b.Property<Guid?>("SeriesId")
 22317                        .HasColumnType("TEXT");
 22318
 22319                    b.Property<string>("SeriesName")
 22320                        .HasColumnType("TEXT");
 22321
 22322                    b.Property<string>("SeriesPresentationUniqueKey")
 22323                        .HasColumnType("TEXT");
 22324
 22325                    b.Property<string>("ShowId")
 22326                        .HasColumnType("TEXT");
 22327
 22328                    b.Property<long?>("Size")
 22329                        .HasColumnType("INTEGER");
 22330
 22331                    b.Property<string>("SortName")
 22332                        .HasColumnType("TEXT");
 22333
 22334                    b.Property<DateTime>("StartDate")
 22335                        .HasColumnType("TEXT");
 22336
 22337                    b.Property<string>("Studios")
 22338                        .HasColumnType("TEXT");
 22339
 22340                    b.Property<string>("Tagline")
 22341                        .HasColumnType("TEXT");
 22342
 22343                    b.Property<string>("Tags")
 22344                        .HasColumnType("TEXT");
 22345
 22346                    b.Property<Guid?>("TopParentId")
 22347                        .HasColumnType("TEXT");
 22348
 22349                    b.Property<int?>("TotalBitrate")
 22350                        .HasColumnType("INTEGER");
 22351
 22352                    b.Property<string>("Type")
 22353                        .IsRequired()
 22354                        .HasColumnType("TEXT");
 22355
 22356                    b.Property<string>("UnratedType")
 22357                        .HasColumnType("TEXT");
 22358
 22359                    b.Property<int?>("Width")
 22360                        .HasColumnType("INTEGER");
 22361
 22362                    b.HasKey("Id");
 22363
 22364                    b.HasIndex("ParentId");
 22365
 22366                    b.HasIndex("Path");
 22367
 22368                    b.HasIndex("PresentationUniqueKey");
 22369
 22370                    b.HasIndex("TopParentId", "Id");
 22371
 22372                    b.HasIndex("Type", "TopParentId", "Id");
 22373
 22374                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 22375
 22376                    b.HasIndex("Type", "TopParentId", "StartDate");
 22377
 22378                    b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem");
 22379
 22380                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 22381
 22382                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 22383
 22384                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 22385
 22386                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 22387
 22388                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 22389
 22390                    b.ToTable("BaseItems");
 22391                });
 392
 22393            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b =>
 22394                {
 22395                    b.Property<Guid>("Id")
 22396                        .ValueGeneratedOnAdd()
 22397                        .HasColumnType("TEXT");
 22398
 22399                    b.Property<byte[]>("Blurhash")
 22400                        .HasColumnType("BLOB");
 22401
 22402                    b.Property<DateTime>("DateModified")
 22403                        .HasColumnType("TEXT");
 22404
 22405                    b.Property<int>("Height")
 22406                        .HasColumnType("INTEGER");
 22407
 22408                    b.Property<int>("ImageType")
 22409                        .HasColumnType("INTEGER");
 22410
 22411                    b.Property<Guid>("ItemId")
 22412                        .HasColumnType("TEXT");
 22413
 22414                    b.Property<string>("Path")
 22415                        .IsRequired()
 22416                        .HasColumnType("TEXT");
 22417
 22418                    b.Property<int>("Width")
 22419                        .HasColumnType("INTEGER");
 22420
 22421                    b.HasKey("Id");
 22422
 22423                    b.HasIndex("ItemId");
 22424
 22425                    b.ToTable("BaseItemImageInfos");
 22426                });
 427
 22428            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b =>
 22429                {
 22430                    b.Property<int>("Id")
 22431                        .HasColumnType("INTEGER");
 22432
 22433                    b.Property<Guid>("ItemId")
 22434                        .HasColumnType("TEXT");
 22435
 22436                    b.HasKey("Id", "ItemId");
 22437
 22438                    b.HasIndex("ItemId");
 22439
 22440                    b.ToTable("BaseItemMetadataFields");
 22441                });
 442
 22443            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b =>
 22444                {
 22445                    b.Property<Guid>("ItemId")
 22446                        .HasColumnType("TEXT");
 22447
 22448                    b.Property<string>("ProviderId")
 22449                        .HasColumnType("TEXT");
 22450
 22451                    b.Property<string>("ProviderValue")
 22452                        .IsRequired()
 22453                        .HasColumnType("TEXT");
 22454
 22455                    b.HasKey("ItemId", "ProviderId");
 22456
 22457                    b.HasIndex("ProviderId", "ProviderValue", "ItemId");
 22458
 22459                    b.ToTable("BaseItemProviders");
 22460                });
 461
 22462            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b =>
 22463                {
 22464                    b.Property<int>("Id")
 22465                        .HasColumnType("INTEGER");
 22466
 22467                    b.Property<Guid>("ItemId")
 22468                        .HasColumnType("TEXT");
 22469
 22470                    b.HasKey("Id", "ItemId");
 22471
 22472                    b.HasIndex("ItemId");
 22473
 22474                    b.ToTable("BaseItemTrailerTypes");
 22475                });
 476
 22477            modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b =>
 22478                {
 22479                    b.Property<Guid>("ItemId")
 22480                        .HasColumnType("TEXT");
 22481
 22482                    b.Property<int>("ChapterIndex")
 22483                        .HasColumnType("INTEGER");
 22484
 22485                    b.Property<DateTime?>("ImageDateModified")
 22486                        .HasColumnType("TEXT");
 22487
 22488                    b.Property<string>("ImagePath")
 22489                        .HasColumnType("TEXT");
 22490
 22491                    b.Property<string>("Name")
 22492                        .HasColumnType("TEXT");
 22493
 22494                    b.Property<long>("StartPositionTicks")
 22495                        .HasColumnType("INTEGER");
 22496
 22497                    b.HasKey("ItemId", "ChapterIndex");
 22498
 22499                    b.ToTable("Chapters");
 22500                });
 501
 22502            modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b =>
 22503                {
 22504                    b.Property<int>("Id")
 22505                        .ValueGeneratedOnAdd()
 22506                        .HasColumnType("INTEGER");
 22507
 22508                    b.Property<string>("Client")
 22509                        .IsRequired()
 22510                        .HasMaxLength(32)
 22511                        .HasColumnType("TEXT");
 22512
 22513                    b.Property<Guid>("ItemId")
 22514                        .HasColumnType("TEXT");
 22515
 22516                    b.Property<string>("Key")
 22517                        .IsRequired()
 22518                        .HasColumnType("TEXT");
 22519
 22520                    b.Property<Guid>("UserId")
 22521                        .HasColumnType("TEXT");
 22522
 22523                    b.Property<string>("Value")
 22524                        .HasColumnType("TEXT");
 22525
 22526                    b.HasKey("Id");
 22527
 22528                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 22529                        .IsUnique();
 22530
 22531                    b.ToTable("CustomItemDisplayPreferences");
 22532                });
 533
 22534            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22535                {
 22536                    b.Property<int>("Id")
 22537                        .ValueGeneratedOnAdd()
 22538                        .HasColumnType("INTEGER");
 22539
 22540                    b.Property<int>("ChromecastVersion")
 22541                        .HasColumnType("INTEGER");
 22542
 22543                    b.Property<string>("Client")
 22544                        .IsRequired()
 22545                        .HasMaxLength(32)
 22546                        .HasColumnType("TEXT");
 22547
 22548                    b.Property<string>("DashboardTheme")
 22549                        .HasMaxLength(32)
 22550                        .HasColumnType("TEXT");
 22551
 22552                    b.Property<bool>("EnableNextVideoInfoOverlay")
 22553                        .HasColumnType("INTEGER");
 22554
 22555                    b.Property<int?>("IndexBy")
 22556                        .HasColumnType("INTEGER");
 22557
 22558                    b.Property<Guid>("ItemId")
 22559                        .HasColumnType("TEXT");
 22560
 22561                    b.Property<int>("ScrollDirection")
 22562                        .HasColumnType("INTEGER");
 22563
 22564                    b.Property<bool>("ShowBackdrop")
 22565                        .HasColumnType("INTEGER");
 22566
 22567                    b.Property<bool>("ShowSidebar")
 22568                        .HasColumnType("INTEGER");
 22569
 22570                    b.Property<int>("SkipBackwardLength")
 22571                        .HasColumnType("INTEGER");
 22572
 22573                    b.Property<int>("SkipForwardLength")
 22574                        .HasColumnType("INTEGER");
 22575
 22576                    b.Property<string>("TvHome")
 22577                        .HasMaxLength(32)
 22578                        .HasColumnType("TEXT");
 22579
 22580                    b.Property<Guid>("UserId")
 22581                        .HasColumnType("TEXT");
 22582
 22583                    b.HasKey("Id");
 22584
 22585                    b.HasIndex("UserId", "ItemId", "Client")
 22586                        .IsUnique();
 22587
 22588                    b.ToTable("DisplayPreferences");
 22589                });
 590
 22591            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22592                {
 22593                    b.Property<int>("Id")
 22594                        .ValueGeneratedOnAdd()
 22595                        .HasColumnType("INTEGER");
 22596
 22597                    b.Property<int>("DisplayPreferencesId")
 22598                        .HasColumnType("INTEGER");
 22599
 22600                    b.Property<int>("Order")
 22601                        .HasColumnType("INTEGER");
 22602
 22603                    b.Property<int>("Type")
 22604                        .HasColumnType("INTEGER");
 22605
 22606                    b.HasKey("Id");
 22607
 22608                    b.HasIndex("DisplayPreferencesId");
 22609
 22610                    b.ToTable("HomeSection");
 22611                });
 612
 22613            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22614                {
 22615                    b.Property<int>("Id")
 22616                        .ValueGeneratedOnAdd()
 22617                        .HasColumnType("INTEGER");
 22618
 22619                    b.Property<DateTime>("LastModified")
 22620                        .HasColumnType("TEXT");
 22621
 22622                    b.Property<string>("Path")
 22623                        .IsRequired()
 22624                        .HasMaxLength(512)
 22625                        .HasColumnType("TEXT");
 22626
 22627                    b.Property<Guid?>("UserId")
 22628                        .HasColumnType("TEXT");
 22629
 22630                    b.HasKey("Id");
 22631
 22632                    b.HasIndex("UserId")
 22633                        .IsUnique();
 22634
 22635                    b.ToTable("ImageInfos");
 22636                });
 637
 22638            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22639                {
 22640                    b.Property<int>("Id")
 22641                        .ValueGeneratedOnAdd()
 22642                        .HasColumnType("INTEGER");
 22643
 22644                    b.Property<string>("Client")
 22645                        .IsRequired()
 22646                        .HasMaxLength(32)
 22647                        .HasColumnType("TEXT");
 22648
 22649                    b.Property<int?>("IndexBy")
 22650                        .HasColumnType("INTEGER");
 22651
 22652                    b.Property<Guid>("ItemId")
 22653                        .HasColumnType("TEXT");
 22654
 22655                    b.Property<bool>("RememberIndexing")
 22656                        .HasColumnType("INTEGER");
 22657
 22658                    b.Property<bool>("RememberSorting")
 22659                        .HasColumnType("INTEGER");
 22660
 22661                    b.Property<string>("SortBy")
 22662                        .IsRequired()
 22663                        .HasMaxLength(64)
 22664                        .HasColumnType("TEXT");
 22665
 22666                    b.Property<int>("SortOrder")
 22667                        .HasColumnType("INTEGER");
 22668
 22669                    b.Property<Guid>("UserId")
 22670                        .HasColumnType("TEXT");
 22671
 22672                    b.Property<int>("ViewType")
 22673                        .HasColumnType("INTEGER");
 22674
 22675                    b.HasKey("Id");
 22676
 22677                    b.HasIndex("UserId");
 22678
 22679                    b.ToTable("ItemDisplayPreferences");
 22680                });
 681
 22682            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b =>
 22683                {
 22684                    b.Property<Guid>("ItemValueId")
 22685                        .ValueGeneratedOnAdd()
 22686                        .HasColumnType("TEXT");
 22687
 22688                    b.Property<string>("CleanValue")
 22689                        .IsRequired()
 22690                        .HasColumnType("TEXT");
 22691
 22692                    b.Property<int>("Type")
 22693                        .HasColumnType("INTEGER");
 22694
 22695                    b.Property<string>("Value")
 22696                        .IsRequired()
 22697                        .HasColumnType("TEXT");
 22698
 22699                    b.HasKey("ItemValueId");
 22700
 22701                    b.HasIndex("Type", "CleanValue");
 22702
 22703                    b.ToTable("ItemValues");
 22704                });
 705
 22706            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b =>
 22707                {
 22708                    b.Property<Guid>("ItemValueId")
 22709                        .HasColumnType("TEXT");
 22710
 22711                    b.Property<Guid>("ItemId")
 22712                        .HasColumnType("TEXT");
 22713
 22714                    b.HasKey("ItemValueId", "ItemId");
 22715
 22716                    b.HasIndex("ItemId");
 22717
 22718                    b.ToTable("ItemValuesMap");
 22719                });
 720
 22721            modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b =>
 22722                {
 22723                    b.Property<Guid>("Id")
 22724                        .ValueGeneratedOnAdd()
 22725                        .HasColumnType("TEXT");
 22726
 22727                    b.Property<long>("EndTicks")
 22728                        .HasColumnType("INTEGER");
 22729
 22730                    b.Property<Guid>("ItemId")
 22731                        .HasColumnType("TEXT");
 22732
 22733                    b.Property<string>("SegmentProviderId")
 22734                        .IsRequired()
 22735                        .HasColumnType("TEXT");
 22736
 22737                    b.Property<long>("StartTicks")
 22738                        .HasColumnType("INTEGER");
 22739
 22740                    b.Property<int>("Type")
 22741                        .HasColumnType("INTEGER");
 22742
 22743                    b.HasKey("Id");
 22744
 22745                    b.ToTable("MediaSegments");
 22746                });
 747
 22748            modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b =>
 22749                {
 22750                    b.Property<Guid>("ItemId")
 22751                        .HasColumnType("TEXT");
 22752
 22753                    b.Property<int>("StreamIndex")
 22754                        .HasColumnType("INTEGER");
 22755
 22756                    b.Property<string>("AspectRatio")
 22757                        .HasColumnType("TEXT");
 22758
 22759                    b.Property<float>("AverageFrameRate")
 22760                        .HasColumnType("REAL");
 22761
 22762                    b.Property<int>("BitDepth")
 22763                        .HasColumnType("INTEGER");
 22764
 22765                    b.Property<int>("BitRate")
 22766                        .HasColumnType("INTEGER");
 22767
 22768                    b.Property<int>("BlPresentFlag")
 22769                        .HasColumnType("INTEGER");
 22770
 22771                    b.Property<string>("ChannelLayout")
 22772                        .HasColumnType("TEXT");
 22773
 22774                    b.Property<int>("Channels")
 22775                        .HasColumnType("INTEGER");
 22776
 22777                    b.Property<string>("Codec")
 22778                        .HasColumnType("TEXT");
 22779
 22780                    b.Property<string>("CodecTag")
 22781                        .IsRequired()
 22782                        .HasColumnType("TEXT");
 22783
 22784                    b.Property<string>("CodecTimeBase")
 22785                        .IsRequired()
 22786                        .HasColumnType("TEXT");
 22787
 22788                    b.Property<string>("ColorPrimaries")
 22789                        .IsRequired()
 22790                        .HasColumnType("TEXT");
 22791
 22792                    b.Property<string>("ColorSpace")
 22793                        .IsRequired()
 22794                        .HasColumnType("TEXT");
 22795
 22796                    b.Property<string>("ColorTransfer")
 22797                        .IsRequired()
 22798                        .HasColumnType("TEXT");
 22799
 22800                    b.Property<string>("Comment")
 22801                        .IsRequired()
 22802                        .HasColumnType("TEXT");
 22803
 22804                    b.Property<int>("DvBlSignalCompatibilityId")
 22805                        .HasColumnType("INTEGER");
 22806
 22807                    b.Property<int>("DvLevel")
 22808                        .HasColumnType("INTEGER");
 22809
 22810                    b.Property<int>("DvProfile")
 22811                        .HasColumnType("INTEGER");
 22812
 22813                    b.Property<int>("DvVersionMajor")
 22814                        .HasColumnType("INTEGER");
 22815
 22816                    b.Property<int>("DvVersionMinor")
 22817                        .HasColumnType("INTEGER");
 22818
 22819                    b.Property<int>("ElPresentFlag")
 22820                        .HasColumnType("INTEGER");
 22821
 22822                    b.Property<int>("Height")
 22823                        .HasColumnType("INTEGER");
 22824
 22825                    b.Property<bool>("IsAnamorphic")
 22826                        .HasColumnType("INTEGER");
 22827
 22828                    b.Property<bool>("IsAvc")
 22829                        .HasColumnType("INTEGER");
 22830
 22831                    b.Property<bool>("IsDefault")
 22832                        .HasColumnType("INTEGER");
 22833
 22834                    b.Property<bool>("IsExternal")
 22835                        .HasColumnType("INTEGER");
 22836
 22837                    b.Property<bool>("IsForced")
 22838                        .HasColumnType("INTEGER");
 22839
 22840                    b.Property<bool>("IsHearingImpaired")
 22841                        .HasColumnType("INTEGER");
 22842
 22843                    b.Property<bool>("IsInterlaced")
 22844                        .HasColumnType("INTEGER");
 22845
 22846                    b.Property<string>("KeyFrames")
 22847                        .HasColumnType("TEXT");
 22848
 22849                    b.Property<string>("Language")
 22850                        .HasColumnType("TEXT");
 22851
 22852                    b.Property<float>("Level")
 22853                        .HasColumnType("REAL");
 22854
 22855                    b.Property<string>("NalLengthSize")
 22856                        .IsRequired()
 22857                        .HasColumnType("TEXT");
 22858
 22859                    b.Property<string>("Path")
 22860                        .HasColumnType("TEXT");
 22861
 22862                    b.Property<string>("PixelFormat")
 22863                        .HasColumnType("TEXT");
 22864
 22865                    b.Property<string>("Profile")
 22866                        .HasColumnType("TEXT");
 22867
 22868                    b.Property<float>("RealFrameRate")
 22869                        .HasColumnType("REAL");
 22870
 22871                    b.Property<int>("RefFrames")
 22872                        .HasColumnType("INTEGER");
 22873
 22874                    b.Property<int>("Rotation")
 22875                        .HasColumnType("INTEGER");
 22876
 22877                    b.Property<int>("RpuPresentFlag")
 22878                        .HasColumnType("INTEGER");
 22879
 22880                    b.Property<int>("SampleRate")
 22881                        .HasColumnType("INTEGER");
 22882
 22883                    b.Property<int?>("StreamType")
 22884                        .HasColumnType("INTEGER");
 22885
 22886                    b.Property<string>("TimeBase")
 22887                        .IsRequired()
 22888                        .HasColumnType("TEXT");
 22889
 22890                    b.Property<string>("Title")
 22891                        .IsRequired()
 22892                        .HasColumnType("TEXT");
 22893
 22894                    b.Property<int>("Width")
 22895                        .HasColumnType("INTEGER");
 22896
 22897                    b.HasKey("ItemId", "StreamIndex");
 22898
 22899                    b.HasIndex("StreamIndex");
 22900
 22901                    b.HasIndex("StreamType");
 22902
 22903                    b.HasIndex("StreamIndex", "StreamType");
 22904
 22905                    b.HasIndex("StreamIndex", "StreamType", "Language");
 22906
 22907                    b.ToTable("MediaStreamInfos");
 22908                });
 909
 22910            modelBuilder.Entity("Jellyfin.Data.Entities.People", b =>
 22911                {
 22912                    b.Property<Guid>("Id")
 22913                        .ValueGeneratedOnAdd()
 22914                        .HasColumnType("TEXT");
 22915
 22916                    b.Property<string>("Name")
 22917                        .IsRequired()
 22918                        .HasColumnType("TEXT");
 22919
 22920                    b.Property<string>("PersonType")
 22921                        .HasColumnType("TEXT");
 22922
 22923                    b.HasKey("Id");
 22924
 22925                    b.HasIndex("Name");
 22926
 22927                    b.ToTable("Peoples");
 22928                });
 929
 22930            modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b =>
 22931                {
 22932                    b.Property<Guid>("ItemId")
 22933                        .HasColumnType("TEXT");
 22934
 22935                    b.Property<Guid>("PeopleId")
 22936                        .HasColumnType("TEXT");
 22937
 22938                    b.Property<int?>("ListOrder")
 22939                        .HasColumnType("INTEGER");
 22940
 22941                    b.Property<string>("Role")
 22942                        .HasColumnType("TEXT");
 22943
 22944                    b.Property<int?>("SortOrder")
 22945                        .HasColumnType("INTEGER");
 22946
 22947                    b.HasKey("ItemId", "PeopleId");
 22948
 22949                    b.HasIndex("PeopleId");
 22950
 22951                    b.HasIndex("ItemId", "ListOrder");
 22952
 22953                    b.HasIndex("ItemId", "SortOrder");
 22954
 22955                    b.ToTable("PeopleBaseItemMap");
 22956                });
 957
 22958            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22959                {
 22960                    b.Property<int>("Id")
 22961                        .ValueGeneratedOnAdd()
 22962                        .HasColumnType("INTEGER");
 22963
 22964                    b.Property<int>("Kind")
 22965                        .HasColumnType("INTEGER");
 22966
 22967                    b.Property<Guid?>("Permission_Permissions_Guid")
 22968                        .HasColumnType("TEXT");
 22969
 22970                    b.Property<uint>("RowVersion")
 22971                        .IsConcurrencyToken()
 22972                        .HasColumnType("INTEGER");
 22973
 22974                    b.Property<Guid?>("UserId")
 22975                        .HasColumnType("TEXT");
 22976
 22977                    b.Property<bool>("Value")
 22978                        .HasColumnType("INTEGER");
 22979
 22980                    b.HasKey("Id");
 22981
 22982                    b.HasIndex("UserId", "Kind")
 22983                        .IsUnique()
 22984                        .HasFilter("[UserId] IS NOT NULL");
 22985
 22986                    b.ToTable("Permissions");
 22987                });
 988
 22989            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22990                {
 22991                    b.Property<int>("Id")
 22992                        .ValueGeneratedOnAdd()
 22993                        .HasColumnType("INTEGER");
 22994
 22995                    b.Property<int>("Kind")
 22996                        .HasColumnType("INTEGER");
 22997
 22998                    b.Property<Guid?>("Preference_Preferences_Guid")
 22999                        .HasColumnType("TEXT");
 221000
 221001                    b.Property<uint>("RowVersion")
 221002                        .IsConcurrencyToken()
 221003                        .HasColumnType("INTEGER");
 221004
 221005                    b.Property<Guid?>("UserId")
 221006                        .HasColumnType("TEXT");
 221007
 221008                    b.Property<string>("Value")
 221009                        .IsRequired()
 221010                        .HasMaxLength(65535)
 221011                        .HasColumnType("TEXT");
 221012
 221013                    b.HasKey("Id");
 221014
 221015                    b.HasIndex("UserId", "Kind")
 221016                        .IsUnique()
 221017                        .HasFilter("[UserId] IS NOT NULL");
 221018
 221019                    b.ToTable("Preferences");
 221020                });
 1021
 221022            modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b =>
 221023                {
 221024                    b.Property<int>("Id")
 221025                        .ValueGeneratedOnAdd()
 221026                        .HasColumnType("INTEGER");
 221027
 221028                    b.Property<string>("AccessToken")
 221029                        .IsRequired()
 221030                        .HasColumnType("TEXT");
 221031
 221032                    b.Property<DateTime>("DateCreated")
 221033                        .HasColumnType("TEXT");
 221034
 221035                    b.Property<DateTime>("DateLastActivity")
 221036                        .HasColumnType("TEXT");
 221037
 221038                    b.Property<string>("Name")
 221039                        .IsRequired()
 221040                        .HasMaxLength(64)
 221041                        .HasColumnType("TEXT");
 221042
 221043                    b.HasKey("Id");
 221044
 221045                    b.HasIndex("AccessToken")
 221046                        .IsUnique();
 221047
 221048                    b.ToTable("ApiKeys");
 221049                });
 1050
 221051            modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b =>
 221052                {
 221053                    b.Property<int>("Id")
 221054                        .ValueGeneratedOnAdd()
 221055                        .HasColumnType("INTEGER");
 221056
 221057                    b.Property<string>("AccessToken")
 221058                        .IsRequired()
 221059                        .HasColumnType("TEXT");
 221060
 221061                    b.Property<string>("AppName")
 221062                        .IsRequired()
 221063                        .HasMaxLength(64)
 221064                        .HasColumnType("TEXT");
 221065
 221066                    b.Property<string>("AppVersion")
 221067                        .IsRequired()
 221068                        .HasMaxLength(32)
 221069                        .HasColumnType("TEXT");
 221070
 221071                    b.Property<DateTime>("DateCreated")
 221072                        .HasColumnType("TEXT");
 221073
 221074                    b.Property<DateTime>("DateLastActivity")
 221075                        .HasColumnType("TEXT");
 221076
 221077                    b.Property<DateTime>("DateModified")
 221078                        .HasColumnType("TEXT");
 221079
 221080                    b.Property<string>("DeviceId")
 221081                        .IsRequired()
 221082                        .HasMaxLength(256)
 221083                        .HasColumnType("TEXT");
 221084
 221085                    b.Property<string>("DeviceName")
 221086                        .IsRequired()
 221087                        .HasMaxLength(64)
 221088                        .HasColumnType("TEXT");
 221089
 221090                    b.Property<bool>("IsActive")
 221091                        .HasColumnType("INTEGER");
 221092
 221093                    b.Property<Guid>("UserId")
 221094                        .HasColumnType("TEXT");
 221095
 221096                    b.HasKey("Id");
 221097
 221098                    b.HasIndex("DeviceId");
 221099
 221100                    b.HasIndex("AccessToken", "DateLastActivity");
 221101
 221102                    b.HasIndex("DeviceId", "DateLastActivity");
 221103
 221104                    b.HasIndex("UserId", "DeviceId");
 221105
 221106                    b.ToTable("Devices");
 221107                });
 1108
 221109            modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b =>
 221110                {
 221111                    b.Property<int>("Id")
 221112                        .ValueGeneratedOnAdd()
 221113                        .HasColumnType("INTEGER");
 221114
 221115                    b.Property<string>("CustomName")
 221116                        .HasColumnType("TEXT");
 221117
 221118                    b.Property<string>("DeviceId")
 221119                        .IsRequired()
 221120                        .HasColumnType("TEXT");
 221121
 221122                    b.HasKey("Id");
 221123
 221124                    b.HasIndex("DeviceId")
 221125                        .IsUnique();
 221126
 221127                    b.ToTable("DeviceOptions");
 221128                });
 1129
 221130            modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b =>
 221131                {
 221132                    b.Property<Guid>("ItemId")
 221133                        .HasColumnType("TEXT");
 221134
 221135                    b.Property<int>("Width")
 221136                        .HasColumnType("INTEGER");
 221137
 221138                    b.Property<int>("Bandwidth")
 221139                        .HasColumnType("INTEGER");
 221140
 221141                    b.Property<int>("Height")
 221142                        .HasColumnType("INTEGER");
 221143
 221144                    b.Property<int>("Interval")
 221145                        .HasColumnType("INTEGER");
 221146
 221147                    b.Property<int>("ThumbnailCount")
 221148                        .HasColumnType("INTEGER");
 221149
 221150                    b.Property<int>("TileHeight")
 221151                        .HasColumnType("INTEGER");
 221152
 221153                    b.Property<int>("TileWidth")
 221154                        .HasColumnType("INTEGER");
 221155
 221156                    b.HasKey("ItemId", "Width");
 221157
 221158                    b.ToTable("TrickplayInfos");
 221159                });
 1160
 221161            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 221162                {
 221163                    b.Property<Guid>("Id")
 221164                        .ValueGeneratedOnAdd()
 221165                        .HasColumnType("TEXT");
 221166
 221167                    b.Property<string>("AudioLanguagePreference")
 221168                        .HasMaxLength(255)
 221169                        .HasColumnType("TEXT");
 221170
 221171                    b.Property<string>("AuthenticationProviderId")
 221172                        .IsRequired()
 221173                        .HasMaxLength(255)
 221174                        .HasColumnType("TEXT");
 221175
 221176                    b.Property<string>("CastReceiverId")
 221177                        .HasMaxLength(32)
 221178                        .HasColumnType("TEXT");
 221179
 221180                    b.Property<bool>("DisplayCollectionsView")
 221181                        .HasColumnType("INTEGER");
 221182
 221183                    b.Property<bool>("DisplayMissingEpisodes")
 221184                        .HasColumnType("INTEGER");
 221185
 221186                    b.Property<bool>("EnableAutoLogin")
 221187                        .HasColumnType("INTEGER");
 221188
 221189                    b.Property<bool>("EnableLocalPassword")
 221190                        .HasColumnType("INTEGER");
 221191
 221192                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 221193                        .HasColumnType("INTEGER");
 221194
 221195                    b.Property<bool>("EnableUserPreferenceAccess")
 221196                        .HasColumnType("INTEGER");
 221197
 221198                    b.Property<bool>("HidePlayedInLatest")
 221199                        .HasColumnType("INTEGER");
 221200
 221201                    b.Property<long>("InternalId")
 221202                        .HasColumnType("INTEGER");
 221203
 221204                    b.Property<int>("InvalidLoginAttemptCount")
 221205                        .HasColumnType("INTEGER");
 221206
 221207                    b.Property<DateTime?>("LastActivityDate")
 221208                        .HasColumnType("TEXT");
 221209
 221210                    b.Property<DateTime?>("LastLoginDate")
 221211                        .HasColumnType("TEXT");
 221212
 221213                    b.Property<int?>("LoginAttemptsBeforeLockout")
 221214                        .HasColumnType("INTEGER");
 221215
 221216                    b.Property<int>("MaxActiveSessions")
 221217                        .HasColumnType("INTEGER");
 221218
 221219                    b.Property<int?>("MaxParentalAgeRating")
 221220                        .HasColumnType("INTEGER");
 221221
 221222                    b.Property<bool>("MustUpdatePassword")
 221223                        .HasColumnType("INTEGER");
 221224
 221225                    b.Property<string>("Password")
 221226                        .HasMaxLength(65535)
 221227                        .HasColumnType("TEXT");
 221228
 221229                    b.Property<string>("PasswordResetProviderId")
 221230                        .IsRequired()
 221231                        .HasMaxLength(255)
 221232                        .HasColumnType("TEXT");
 221233
 221234                    b.Property<bool>("PlayDefaultAudioTrack")
 221235                        .HasColumnType("INTEGER");
 221236
 221237                    b.Property<bool>("RememberAudioSelections")
 221238                        .HasColumnType("INTEGER");
 221239
 221240                    b.Property<bool>("RememberSubtitleSelections")
 221241                        .HasColumnType("INTEGER");
 221242
 221243                    b.Property<int?>("RemoteClientBitrateLimit")
 221244                        .HasColumnType("INTEGER");
 221245
 221246                    b.Property<uint>("RowVersion")
 221247                        .IsConcurrencyToken()
 221248                        .HasColumnType("INTEGER");
 221249
 221250                    b.Property<string>("SubtitleLanguagePreference")
 221251                        .HasMaxLength(255)
 221252                        .HasColumnType("TEXT");
 221253
 221254                    b.Property<int>("SubtitleMode")
 221255                        .HasColumnType("INTEGER");
 221256
 221257                    b.Property<int>("SyncPlayAccess")
 221258                        .HasColumnType("INTEGER");
 221259
 221260                    b.Property<string>("Username")
 221261                        .IsRequired()
 221262                        .HasMaxLength(255)
 221263                        .HasColumnType("TEXT")
 221264                        .UseCollation("NOCASE");
 221265
 221266                    b.HasKey("Id");
 221267
 221268                    b.HasIndex("Username")
 221269                        .IsUnique();
 221270
 221271                    b.ToTable("Users");
 221272                });
 1273
 221274            modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
 221275                {
 221276                    b.Property<Guid>("ItemId")
 221277                        .HasColumnType("TEXT");
 221278
 221279                    b.Property<Guid>("UserId")
 221280                        .HasColumnType("TEXT");
 221281
 221282                    b.Property<int?>("AudioStreamIndex")
 221283                        .HasColumnType("INTEGER");
 221284
 221285                    b.Property<bool>("IsFavorite")
 221286                        .HasColumnType("INTEGER");
 221287
 221288                    b.Property<DateTime?>("LastPlayedDate")
 221289                        .HasColumnType("TEXT");
 221290
 221291                    b.Property<bool?>("Likes")
 221292                        .HasColumnType("INTEGER");
 221293
 221294                    b.Property<int>("PlayCount")
 221295                        .HasColumnType("INTEGER");
 221296
 221297                    b.Property<long>("PlaybackPositionTicks")
 221298                        .HasColumnType("INTEGER");
 221299
 221300                    b.Property<bool>("Played")
 221301                        .HasColumnType("INTEGER");
 221302
 221303                    b.Property<double?>("Rating")
 221304                        .HasColumnType("REAL");
 221305
 221306                    b.Property<int?>("SubtitleStreamIndex")
 221307                        .HasColumnType("INTEGER");
 221308
 221309                    b.HasKey("ItemId", "UserId");
 221310
 221311                    b.HasIndex("UserId");
 221312
 221313                    b.HasIndex("ItemId", "UserId", "IsFavorite");
 221314
 221315                    b.HasIndex("ItemId", "UserId", "LastPlayedDate");
 221316
 221317                    b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
 221318
 221319                    b.HasIndex("ItemId", "UserId", "Played");
 221320
 221321                    b.ToTable("UserData");
 221322                });
 1323
 221324            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 221325                {
 221326                    b.HasOne("Jellyfin.Data.Entities.User", null)
 221327                        .WithMany("AccessSchedules")
 221328                        .HasForeignKey("UserId")
 221329                        .OnDelete(DeleteBehavior.Cascade)
 221330                        .IsRequired();
 221331                });
 1332
 221333            modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b =>
 221334                {
 221335                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", null)
 221336                        .WithMany("AncestorIds")
 221337                        .HasForeignKey("BaseItemEntityId");
 221338
 221339                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221340                        .WithMany()
 221341                        .HasForeignKey("ItemId")
 221342                        .OnDelete(DeleteBehavior.Cascade)
 221343                        .IsRequired();
 221344
 221345                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem")
 221346                        .WithMany()
 221347                        .HasForeignKey("ParentItemId")
 221348                        .OnDelete(DeleteBehavior.Cascade)
 221349                        .IsRequired();
 221350
 221351                    b.Navigation("Item");
 221352
 221353                    b.Navigation("ParentItem");
 221354                });
 1355
 221356            modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b =>
 221357                {
 221358                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221359                        .WithMany()
 221360                        .HasForeignKey("ItemId")
 221361                        .OnDelete(DeleteBehavior.Cascade)
 221362                        .IsRequired();
 221363
 221364                    b.Navigation("Item");
 221365                });
 1366
 221367            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b =>
 221368                {
 221369                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221370                        .WithMany("Images")
 221371                        .HasForeignKey("ItemId")
 221372                        .OnDelete(DeleteBehavior.Cascade)
 221373                        .IsRequired();
 221374
 221375                    b.Navigation("Item");
 221376                });
 1377
 221378            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b =>
 221379                {
 221380                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221381                        .WithMany("LockedFields")
 221382                        .HasForeignKey("ItemId")
 221383                        .OnDelete(DeleteBehavior.Cascade)
 221384                        .IsRequired();
 221385
 221386                    b.Navigation("Item");
 221387                });
 1388
 221389            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b =>
 221390                {
 221391                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221392                        .WithMany("Provider")
 221393                        .HasForeignKey("ItemId")
 221394                        .OnDelete(DeleteBehavior.Cascade)
 221395                        .IsRequired();
 221396
 221397                    b.Navigation("Item");
 221398                });
 1399
 221400            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b =>
 221401                {
 221402                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221403                        .WithMany("TrailerTypes")
 221404                        .HasForeignKey("ItemId")
 221405                        .OnDelete(DeleteBehavior.Cascade)
 221406                        .IsRequired();
 221407
 221408                    b.Navigation("Item");
 221409                });
 1410
 221411            modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b =>
 221412                {
 221413                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221414                        .WithMany("Chapters")
 221415                        .HasForeignKey("ItemId")
 221416                        .OnDelete(DeleteBehavior.Cascade)
 221417                        .IsRequired();
 221418
 221419                    b.Navigation("Item");
 221420                });
 1421
 221422            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 221423                {
 221424                    b.HasOne("Jellyfin.Data.Entities.User", null)
 221425                        .WithMany("DisplayPreferences")
 221426                        .HasForeignKey("UserId")
 221427                        .OnDelete(DeleteBehavior.Cascade)
 221428                        .IsRequired();
 221429                });
 1430
 221431            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 221432                {
 221433                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 221434                        .WithMany("HomeSections")
 221435                        .HasForeignKey("DisplayPreferencesId")
 221436                        .OnDelete(DeleteBehavior.Cascade)
 221437                        .IsRequired();
 221438                });
 1439
 221440            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 221441                {
 221442                    b.HasOne("Jellyfin.Data.Entities.User", null)
 221443                        .WithOne("ProfileImage")
 221444                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId")
 221445                        .OnDelete(DeleteBehavior.Cascade);
 221446                });
 1447
 221448            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 221449                {
 221450                    b.HasOne("Jellyfin.Data.Entities.User", null)
 221451                        .WithMany("ItemDisplayPreferences")
 221452                        .HasForeignKey("UserId")
 221453                        .OnDelete(DeleteBehavior.Cascade)
 221454                        .IsRequired();
 221455                });
 1456
 221457            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b =>
 221458                {
 221459                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221460                        .WithMany("ItemValues")
 221461                        .HasForeignKey("ItemId")
 221462                        .OnDelete(DeleteBehavior.Cascade)
 221463                        .IsRequired();
 221464
 221465                    b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue")
 221466                        .WithMany("BaseItemsMap")
 221467                        .HasForeignKey("ItemValueId")
 221468                        .OnDelete(DeleteBehavior.Cascade)
 221469                        .IsRequired();
 221470
 221471                    b.Navigation("Item");
 221472
 221473                    b.Navigation("ItemValue");
 221474                });
 1475
 221476            modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b =>
 221477                {
 221478                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221479                        .WithMany("MediaStreams")
 221480                        .HasForeignKey("ItemId")
 221481                        .OnDelete(DeleteBehavior.Cascade)
 221482                        .IsRequired();
 221483
 221484                    b.Navigation("Item");
 221485                });
 1486
 221487            modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b =>
 221488                {
 221489                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221490                        .WithMany("Peoples")
 221491                        .HasForeignKey("ItemId")
 221492                        .OnDelete(DeleteBehavior.Cascade)
 221493                        .IsRequired();
 221494
 221495                    b.HasOne("Jellyfin.Data.Entities.People", "People")
 221496                        .WithMany("BaseItems")
 221497                        .HasForeignKey("PeopleId")
 221498                        .OnDelete(DeleteBehavior.Cascade)
 221499                        .IsRequired();
 221500
 221501                    b.Navigation("Item");
 221502
 221503                    b.Navigation("People");
 221504                });
 1505
 221506            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 221507                {
 221508                    b.HasOne("Jellyfin.Data.Entities.User", null)
 221509                        .WithMany("Permissions")
 221510                        .HasForeignKey("UserId")
 221511                        .OnDelete(DeleteBehavior.Cascade);
 221512                });
 1513
 221514            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 221515                {
 221516                    b.HasOne("Jellyfin.Data.Entities.User", null)
 221517                        .WithMany("Preferences")
 221518                        .HasForeignKey("UserId")
 221519                        .OnDelete(DeleteBehavior.Cascade);
 221520                });
 1521
 221522            modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b =>
 221523                {
 221524                    b.HasOne("Jellyfin.Data.Entities.User", "User")
 221525                        .WithMany()
 221526                        .HasForeignKey("UserId")
 221527                        .OnDelete(DeleteBehavior.Cascade)
 221528                        .IsRequired();
 221529
 221530                    b.Navigation("User");
 221531                });
 1532
 221533            modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
 221534                {
 221535                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 221536                        .WithMany("UserData")
 221537                        .HasForeignKey("ItemId")
 221538                        .OnDelete(DeleteBehavior.Cascade)
 221539                        .IsRequired();
 221540
 221541                    b.HasOne("Jellyfin.Data.Entities.User", "User")
 221542                        .WithMany()
 221543                        .HasForeignKey("UserId")
 221544                        .OnDelete(DeleteBehavior.Cascade)
 221545                        .IsRequired();
 221546
 221547                    b.Navigation("Item");
 221548
 221549                    b.Navigation("User");
 221550                });
 1551
 221552            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b =>
 221553                {
 221554                    b.Navigation("AncestorIds");
 221555
 221556                    b.Navigation("Chapters");
 221557
 221558                    b.Navigation("Images");
 221559
 221560                    b.Navigation("ItemValues");
 221561
 221562                    b.Navigation("LockedFields");
 221563
 221564                    b.Navigation("MediaStreams");
 221565
 221566                    b.Navigation("Peoples");
 221567
 221568                    b.Navigation("Provider");
 221569
 221570                    b.Navigation("TrailerTypes");
 221571
 221572                    b.Navigation("UserData");
 221573                });
 1574
 221575            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 221576                {
 221577                    b.Navigation("HomeSections");
 221578                });
 1579
 221580            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b =>
 221581                {
 221582                    b.Navigation("BaseItemsMap");
 221583                });
 1584
 221585            modelBuilder.Entity("Jellyfin.Data.Entities.People", b =>
 221586                {
 221587                    b.Navigation("BaseItems");
 221588                });
 1589
 221590            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 221591                {
 221592                    b.Navigation("AccessSchedules");
 221593
 221594                    b.Navigation("DisplayPreferences");
 221595
 221596                    b.Navigation("ItemDisplayPreferences");
 221597
 221598                    b.Navigation("Permissions");
 221599
 221600                    b.Navigation("Preferences");
 221601
 221602                    b.Navigation("ProfileImage");
 221603                });
 1604#pragma warning restore 612, 618
 221605        }
 1606    }
 1607}