< 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 5/16/2026 - 12:15:55 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        {
 2714            migrationBuilder.CreateTable(
 2715                name: "BaseItems",
 2716                columns: table => new
 2717                {
 2718                    Id = table.Column<Guid>(type: "TEXT", nullable: false),
 2719                    Type = table.Column<string>(type: "TEXT", nullable: false),
 2720                    Data = table.Column<string>(type: "TEXT", nullable: true),
 2721                    Path = table.Column<string>(type: "TEXT", nullable: true),
 2722                    StartDate = table.Column<DateTime>(type: "TEXT", nullable: false),
 2723                    EndDate = table.Column<DateTime>(type: "TEXT", nullable: false),
 2724                    ChannelId = table.Column<string>(type: "TEXT", nullable: true),
 2725                    IsMovie = table.Column<bool>(type: "INTEGER", nullable: false),
 2726                    CommunityRating = table.Column<float>(type: "REAL", nullable: true),
 2727                    CustomRating = table.Column<string>(type: "TEXT", nullable: true),
 2728                    IndexNumber = table.Column<int>(type: "INTEGER", nullable: true),
 2729                    IsLocked = table.Column<bool>(type: "INTEGER", nullable: false),
 2730                    Name = table.Column<string>(type: "TEXT", nullable: true),
 2731                    OfficialRating = table.Column<string>(type: "TEXT", nullable: true),
 2732                    MediaType = table.Column<string>(type: "TEXT", nullable: true),
 2733                    Overview = table.Column<string>(type: "TEXT", nullable: true),
 2734                    ParentIndexNumber = table.Column<int>(type: "INTEGER", nullable: true),
 2735                    PremiereDate = table.Column<DateTime>(type: "TEXT", nullable: true),
 2736                    ProductionYear = table.Column<int>(type: "INTEGER", nullable: true),
 2737                    Genres = table.Column<string>(type: "TEXT", nullable: true),
 2738                    SortName = table.Column<string>(type: "TEXT", nullable: true),
 2739                    ForcedSortName = table.Column<string>(type: "TEXT", nullable: true),
 2740                    RunTimeTicks = table.Column<long>(type: "INTEGER", nullable: true),
 2741                    DateCreated = table.Column<DateTime>(type: "TEXT", nullable: true),
 2742                    DateModified = table.Column<DateTime>(type: "TEXT", nullable: true),
 2743                    IsSeries = table.Column<bool>(type: "INTEGER", nullable: false),
 2744                    EpisodeTitle = table.Column<string>(type: "TEXT", nullable: true),
 2745                    IsRepeat = table.Column<bool>(type: "INTEGER", nullable: false),
 2746                    PreferredMetadataLanguage = table.Column<string>(type: "TEXT", nullable: true),
 2747                    PreferredMetadataCountryCode = table.Column<string>(type: "TEXT", nullable: true),
 2748                    DateLastRefreshed = table.Column<DateTime>(type: "TEXT", nullable: true),
 2749                    DateLastSaved = table.Column<DateTime>(type: "TEXT", nullable: true),
 2750                    IsInMixedFolder = table.Column<bool>(type: "INTEGER", nullable: false),
 2751                    Studios = table.Column<string>(type: "TEXT", nullable: true),
 2752                    ExternalServiceId = table.Column<string>(type: "TEXT", nullable: true),
 2753                    Tags = table.Column<string>(type: "TEXT", nullable: true),
 2754                    IsFolder = table.Column<bool>(type: "INTEGER", nullable: false),
 2755                    InheritedParentalRatingValue = table.Column<int>(type: "INTEGER", nullable: true),
 2756                    UnratedType = table.Column<string>(type: "TEXT", nullable: true),
 2757                    CriticRating = table.Column<float>(type: "REAL", nullable: true),
 2758                    CleanName = table.Column<string>(type: "TEXT", nullable: true),
 2759                    PresentationUniqueKey = table.Column<string>(type: "TEXT", nullable: true),
 2760                    OriginalTitle = table.Column<string>(type: "TEXT", nullable: true),
 2761                    PrimaryVersionId = table.Column<string>(type: "TEXT", nullable: true),
 2762                    DateLastMediaAdded = table.Column<DateTime>(type: "TEXT", nullable: true),
 2763                    Album = table.Column<string>(type: "TEXT", nullable: true),
 2764                    LUFS = table.Column<float>(type: "REAL", nullable: true),
 2765                    NormalizationGain = table.Column<float>(type: "REAL", nullable: true),
 2766                    IsVirtualItem = table.Column<bool>(type: "INTEGER", nullable: false),
 2767                    SeriesName = table.Column<string>(type: "TEXT", nullable: true),
 2768                    SeasonName = table.Column<string>(type: "TEXT", nullable: true),
 2769                    ExternalSeriesId = table.Column<string>(type: "TEXT", nullable: true),
 2770                    Tagline = table.Column<string>(type: "TEXT", nullable: true),
 2771                    ProductionLocations = table.Column<string>(type: "TEXT", nullable: true),
 2772                    ExtraIds = table.Column<string>(type: "TEXT", nullable: true),
 2773                    TotalBitrate = table.Column<int>(type: "INTEGER", nullable: true),
 2774                    ExtraType = table.Column<int>(type: "INTEGER", nullable: true),
 2775                    Artists = table.Column<string>(type: "TEXT", nullable: true),
 2776                    AlbumArtists = table.Column<string>(type: "TEXT", nullable: true),
 2777                    ExternalId = table.Column<string>(type: "TEXT", nullable: true),
 2778                    SeriesPresentationUniqueKey = table.Column<string>(type: "TEXT", nullable: true),
 2779                    ShowId = table.Column<string>(type: "TEXT", nullable: true),
 2780                    OwnerId = table.Column<string>(type: "TEXT", nullable: true),
 2781                    Width = table.Column<int>(type: "INTEGER", nullable: true),
 2782                    Height = table.Column<int>(type: "INTEGER", nullable: true),
 2783                    Size = table.Column<long>(type: "INTEGER", nullable: true),
 2784                    Audio = table.Column<int>(type: "INTEGER", nullable: true),
 2785                    ParentId = table.Column<Guid>(type: "TEXT", nullable: true),
 2786                    TopParentId = table.Column<Guid>(type: "TEXT", nullable: true),
 2787                    SeasonId = table.Column<Guid>(type: "TEXT", nullable: true),
 2788                    SeriesId = table.Column<Guid>(type: "TEXT", nullable: true)
 2789                },
 2790                constraints: table =>
 2791                {
 2792                    table.PrimaryKey("PK_BaseItems", x => x.Id);
 2793                });
 94
 2795            migrationBuilder.CreateTable(
 2796                name: "ItemValues",
 2797                columns: table => new
 2798                {
 2799                    ItemValueId = table.Column<Guid>(type: "TEXT", nullable: false),
 27100                    Type = table.Column<int>(type: "INTEGER", nullable: false),
 27101                    Value = table.Column<string>(type: "TEXT", nullable: false),
 27102                    CleanValue = table.Column<string>(type: "TEXT", nullable: false)
 27103                },
 27104                constraints: table =>
 27105                {
 27106                    table.PrimaryKey("PK_ItemValues", x => x.ItemValueId);
 27107                });
 108
 27109            migrationBuilder.CreateTable(
 27110                name: "Peoples",
 27111                columns: table => new
 27112                {
 27113                    Id = table.Column<Guid>(type: "TEXT", nullable: false),
 27114                    Name = table.Column<string>(type: "TEXT", nullable: false),
 27115                    PersonType = table.Column<string>(type: "TEXT", nullable: true)
 27116                },
 27117                constraints: table =>
 27118                {
 27119                    table.PrimaryKey("PK_Peoples", x => x.Id);
 27120                });
 121
 27122            migrationBuilder.CreateTable(
 27123                name: "AncestorIds",
 27124                columns: table => new
 27125                {
 27126                    ParentItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27127                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27128                    BaseItemEntityId = table.Column<Guid>(type: "TEXT", nullable: true)
 27129                },
 27130                constraints: table =>
 27131                {
 27132                    table.PrimaryKey("PK_AncestorIds", x => new { x.ItemId, x.ParentItemId });
 27133                    table.ForeignKey(
 27134                        name: "FK_AncestorIds_BaseItems_BaseItemEntityId",
 27135                        column: x => x.BaseItemEntityId,
 27136                        principalTable: "BaseItems",
 27137                        principalColumn: "Id");
 27138                    table.ForeignKey(
 27139                        name: "FK_AncestorIds_BaseItems_ItemId",
 27140                        column: x => x.ItemId,
 27141                        principalTable: "BaseItems",
 27142                        principalColumn: "Id",
 27143                        onDelete: ReferentialAction.Cascade);
 27144                    table.ForeignKey(
 27145                        name: "FK_AncestorIds_BaseItems_ParentItemId",
 27146                        column: x => x.ParentItemId,
 27147                        principalTable: "BaseItems",
 27148                        principalColumn: "Id",
 27149                        onDelete: ReferentialAction.Cascade);
 27150                });
 151
 27152            migrationBuilder.CreateTable(
 27153                name: "AttachmentStreamInfos",
 27154                columns: table => new
 27155                {
 27156                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27157                    Index = table.Column<int>(type: "INTEGER", nullable: false),
 27158                    Codec = table.Column<string>(type: "TEXT", nullable: false),
 27159                    CodecTag = table.Column<string>(type: "TEXT", nullable: true),
 27160                    Comment = table.Column<string>(type: "TEXT", nullable: true),
 27161                    Filename = table.Column<string>(type: "TEXT", nullable: true),
 27162                    MimeType = table.Column<string>(type: "TEXT", nullable: true)
 27163                },
 27164                constraints: table =>
 27165                {
 27166                    table.PrimaryKey("PK_AttachmentStreamInfos", x => new { x.ItemId, x.Index });
 27167                    table.ForeignKey(
 27168                        name: "FK_AttachmentStreamInfos_BaseItems_ItemId",
 27169                        column: x => x.ItemId,
 27170                        principalTable: "BaseItems",
 27171                        principalColumn: "Id",
 27172                        onDelete: ReferentialAction.Cascade);
 27173                });
 174
 27175            migrationBuilder.CreateTable(
 27176                name: "BaseItemImageInfos",
 27177                columns: table => new
 27178                {
 27179                    Id = table.Column<Guid>(type: "TEXT", nullable: false),
 27180                    Path = table.Column<string>(type: "TEXT", nullable: false),
 27181                    DateModified = table.Column<DateTime>(type: "TEXT", nullable: false),
 27182                    ImageType = table.Column<int>(type: "INTEGER", nullable: false),
 27183                    Width = table.Column<int>(type: "INTEGER", nullable: false),
 27184                    Height = table.Column<int>(type: "INTEGER", nullable: false),
 27185                    Blurhash = table.Column<byte[]>(type: "BLOB", nullable: true),
 27186                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false)
 27187                },
 27188                constraints: table =>
 27189                {
 27190                    table.PrimaryKey("PK_BaseItemImageInfos", x => x.Id);
 27191                    table.ForeignKey(
 27192                        name: "FK_BaseItemImageInfos_BaseItems_ItemId",
 27193                        column: x => x.ItemId,
 27194                        principalTable: "BaseItems",
 27195                        principalColumn: "Id",
 27196                        onDelete: ReferentialAction.Cascade);
 27197                });
 198
 27199            migrationBuilder.CreateTable(
 27200                name: "BaseItemMetadataFields",
 27201                columns: table => new
 27202                {
 27203                    Id = table.Column<int>(type: "INTEGER", nullable: false),
 27204                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false)
 27205                },
 27206                constraints: table =>
 27207                {
 27208                    table.PrimaryKey("PK_BaseItemMetadataFields", x => new { x.Id, x.ItemId });
 27209                    table.ForeignKey(
 27210                        name: "FK_BaseItemMetadataFields_BaseItems_ItemId",
 27211                        column: x => x.ItemId,
 27212                        principalTable: "BaseItems",
 27213                        principalColumn: "Id",
 27214                        onDelete: ReferentialAction.Cascade);
 27215                });
 216
 27217            migrationBuilder.CreateTable(
 27218                name: "BaseItemProviders",
 27219                columns: table => new
 27220                {
 27221                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27222                    ProviderId = table.Column<string>(type: "TEXT", nullable: false),
 27223                    ProviderValue = table.Column<string>(type: "TEXT", nullable: false)
 27224                },
 27225                constraints: table =>
 27226                {
 27227                    table.PrimaryKey("PK_BaseItemProviders", x => new { x.ItemId, x.ProviderId });
 27228                    table.ForeignKey(
 27229                        name: "FK_BaseItemProviders_BaseItems_ItemId",
 27230                        column: x => x.ItemId,
 27231                        principalTable: "BaseItems",
 27232                        principalColumn: "Id",
 27233                        onDelete: ReferentialAction.Cascade);
 27234                });
 235
 27236            migrationBuilder.CreateTable(
 27237                name: "BaseItemTrailerTypes",
 27238                columns: table => new
 27239                {
 27240                    Id = table.Column<int>(type: "INTEGER", nullable: false),
 27241                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false)
 27242                },
 27243                constraints: table =>
 27244                {
 27245                    table.PrimaryKey("PK_BaseItemTrailerTypes", x => new { x.Id, x.ItemId });
 27246                    table.ForeignKey(
 27247                        name: "FK_BaseItemTrailerTypes_BaseItems_ItemId",
 27248                        column: x => x.ItemId,
 27249                        principalTable: "BaseItems",
 27250                        principalColumn: "Id",
 27251                        onDelete: ReferentialAction.Cascade);
 27252                });
 253
 27254            migrationBuilder.CreateTable(
 27255                name: "Chapters",
 27256                columns: table => new
 27257                {
 27258                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27259                    ChapterIndex = table.Column<int>(type: "INTEGER", nullable: false),
 27260                    StartPositionTicks = table.Column<long>(type: "INTEGER", nullable: false),
 27261                    Name = table.Column<string>(type: "TEXT", nullable: true),
 27262                    ImagePath = table.Column<string>(type: "TEXT", nullable: true),
 27263                    ImageDateModified = table.Column<DateTime>(type: "TEXT", nullable: true)
 27264                },
 27265                constraints: table =>
 27266                {
 27267                    table.PrimaryKey("PK_Chapters", x => new { x.ItemId, x.ChapterIndex });
 27268                    table.ForeignKey(
 27269                        name: "FK_Chapters_BaseItems_ItemId",
 27270                        column: x => x.ItemId,
 27271                        principalTable: "BaseItems",
 27272                        principalColumn: "Id",
 27273                        onDelete: ReferentialAction.Cascade);
 27274                });
 275
 27276            migrationBuilder.CreateTable(
 27277                name: "MediaStreamInfos",
 27278                columns: table => new
 27279                {
 27280                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27281                    StreamIndex = table.Column<int>(type: "INTEGER", nullable: false),
 27282                    StreamType = table.Column<int>(type: "INTEGER", nullable: true),
 27283                    Codec = table.Column<string>(type: "TEXT", nullable: true),
 27284                    Language = table.Column<string>(type: "TEXT", nullable: true),
 27285                    ChannelLayout = table.Column<string>(type: "TEXT", nullable: true),
 27286                    Profile = table.Column<string>(type: "TEXT", nullable: true),
 27287                    AspectRatio = table.Column<string>(type: "TEXT", nullable: true),
 27288                    Path = table.Column<string>(type: "TEXT", nullable: true),
 27289                    IsInterlaced = table.Column<bool>(type: "INTEGER", nullable: false),
 27290                    BitRate = table.Column<int>(type: "INTEGER", nullable: false),
 27291                    Channels = table.Column<int>(type: "INTEGER", nullable: false),
 27292                    SampleRate = table.Column<int>(type: "INTEGER", nullable: false),
 27293                    IsDefault = table.Column<bool>(type: "INTEGER", nullable: false),
 27294                    IsForced = table.Column<bool>(type: "INTEGER", nullable: false),
 27295                    IsExternal = table.Column<bool>(type: "INTEGER", nullable: false),
 27296                    Height = table.Column<int>(type: "INTEGER", nullable: false),
 27297                    Width = table.Column<int>(type: "INTEGER", nullable: false),
 27298                    AverageFrameRate = table.Column<float>(type: "REAL", nullable: false),
 27299                    RealFrameRate = table.Column<float>(type: "REAL", nullable: false),
 27300                    Level = table.Column<float>(type: "REAL", nullable: false),
 27301                    PixelFormat = table.Column<string>(type: "TEXT", nullable: true),
 27302                    BitDepth = table.Column<int>(type: "INTEGER", nullable: false),
 27303                    IsAnamorphic = table.Column<bool>(type: "INTEGER", nullable: false),
 27304                    RefFrames = table.Column<int>(type: "INTEGER", nullable: false),
 27305                    CodecTag = table.Column<string>(type: "TEXT", nullable: false),
 27306                    Comment = table.Column<string>(type: "TEXT", nullable: false),
 27307                    NalLengthSize = table.Column<string>(type: "TEXT", nullable: false),
 27308                    IsAvc = table.Column<bool>(type: "INTEGER", nullable: false),
 27309                    Title = table.Column<string>(type: "TEXT", nullable: false),
 27310                    TimeBase = table.Column<string>(type: "TEXT", nullable: false),
 27311                    CodecTimeBase = table.Column<string>(type: "TEXT", nullable: false),
 27312                    ColorPrimaries = table.Column<string>(type: "TEXT", nullable: false),
 27313                    ColorSpace = table.Column<string>(type: "TEXT", nullable: false),
 27314                    ColorTransfer = table.Column<string>(type: "TEXT", nullable: false),
 27315                    DvVersionMajor = table.Column<int>(type: "INTEGER", nullable: false),
 27316                    DvVersionMinor = table.Column<int>(type: "INTEGER", nullable: false),
 27317                    DvProfile = table.Column<int>(type: "INTEGER", nullable: false),
 27318                    DvLevel = table.Column<int>(type: "INTEGER", nullable: false),
 27319                    RpuPresentFlag = table.Column<int>(type: "INTEGER", nullable: false),
 27320                    ElPresentFlag = table.Column<int>(type: "INTEGER", nullable: false),
 27321                    BlPresentFlag = table.Column<int>(type: "INTEGER", nullable: false),
 27322                    DvBlSignalCompatibilityId = table.Column<int>(type: "INTEGER", nullable: false),
 27323                    IsHearingImpaired = table.Column<bool>(type: "INTEGER", nullable: false),
 27324                    Rotation = table.Column<int>(type: "INTEGER", nullable: false),
 27325                    KeyFrames = table.Column<string>(type: "TEXT", nullable: true)
 27326                },
 27327                constraints: table =>
 27328                {
 27329                    table.PrimaryKey("PK_MediaStreamInfos", x => new { x.ItemId, x.StreamIndex });
 27330                    table.ForeignKey(
 27331                        name: "FK_MediaStreamInfos_BaseItems_ItemId",
 27332                        column: x => x.ItemId,
 27333                        principalTable: "BaseItems",
 27334                        principalColumn: "Id",
 27335                        onDelete: ReferentialAction.Cascade);
 27336                });
 337
 27338            migrationBuilder.CreateTable(
 27339                name: "UserData",
 27340                columns: table => new
 27341                {
 27342                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27343                    UserId = table.Column<Guid>(type: "TEXT", nullable: false),
 27344                    Rating = table.Column<double>(type: "REAL", nullable: true),
 27345                    PlaybackPositionTicks = table.Column<long>(type: "INTEGER", nullable: false),
 27346                    PlayCount = table.Column<int>(type: "INTEGER", nullable: false),
 27347                    IsFavorite = table.Column<bool>(type: "INTEGER", nullable: false),
 27348                    LastPlayedDate = table.Column<DateTime>(type: "TEXT", nullable: true),
 27349                    Played = table.Column<bool>(type: "INTEGER", nullable: false),
 27350                    AudioStreamIndex = table.Column<int>(type: "INTEGER", nullable: true),
 27351                    SubtitleStreamIndex = table.Column<int>(type: "INTEGER", nullable: true),
 27352                    Likes = table.Column<bool>(type: "INTEGER", nullable: true)
 27353                },
 27354                constraints: table =>
 27355                {
 27356                    table.PrimaryKey("PK_UserData", x => new { x.ItemId, x.UserId });
 27357                    table.ForeignKey(
 27358                        name: "FK_UserData_BaseItems_ItemId",
 27359                        column: x => x.ItemId,
 27360                        principalTable: "BaseItems",
 27361                        principalColumn: "Id",
 27362                        onDelete: ReferentialAction.Cascade);
 27363                    table.ForeignKey(
 27364                        name: "FK_UserData_Users_UserId",
 27365                        column: x => x.UserId,
 27366                        principalTable: "Users",
 27367                        principalColumn: "Id",
 27368                        onDelete: ReferentialAction.Cascade);
 27369                });
 370
 27371            migrationBuilder.CreateTable(
 27372                name: "ItemValuesMap",
 27373                columns: table => new
 27374                {
 27375                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27376                    ItemValueId = table.Column<Guid>(type: "TEXT", nullable: false)
 27377                },
 27378                constraints: table =>
 27379                {
 27380                    table.PrimaryKey("PK_ItemValuesMap", x => new { x.ItemValueId, x.ItemId });
 27381                    table.ForeignKey(
 27382                        name: "FK_ItemValuesMap_BaseItems_ItemId",
 27383                        column: x => x.ItemId,
 27384                        principalTable: "BaseItems",
 27385                        principalColumn: "Id",
 27386                        onDelete: ReferentialAction.Cascade);
 27387                    table.ForeignKey(
 27388                        name: "FK_ItemValuesMap_ItemValues_ItemValueId",
 27389                        column: x => x.ItemValueId,
 27390                        principalTable: "ItemValues",
 27391                        principalColumn: "ItemValueId",
 27392                        onDelete: ReferentialAction.Cascade);
 27393                });
 394
 27395            migrationBuilder.CreateTable(
 27396                name: "PeopleBaseItemMap",
 27397                columns: table => new
 27398                {
 27399                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 27400                    PeopleId = table.Column<Guid>(type: "TEXT", nullable: false),
 27401                    SortOrder = table.Column<int>(type: "INTEGER", nullable: true),
 27402                    ListOrder = table.Column<int>(type: "INTEGER", nullable: true),
 27403                    Role = table.Column<string>(type: "TEXT", nullable: true)
 27404                },
 27405                constraints: table =>
 27406                {
 27407                    table.PrimaryKey("PK_PeopleBaseItemMap", x => new { x.ItemId, x.PeopleId });
 27408                    table.ForeignKey(
 27409                        name: "FK_PeopleBaseItemMap_BaseItems_ItemId",
 27410                        column: x => x.ItemId,
 27411                        principalTable: "BaseItems",
 27412                        principalColumn: "Id",
 27413                        onDelete: ReferentialAction.Cascade);
 27414                    table.ForeignKey(
 27415                        name: "FK_PeopleBaseItemMap_Peoples_PeopleId",
 27416                        column: x => x.PeopleId,
 27417                        principalTable: "Peoples",
 27418                        principalColumn: "Id",
 27419                        onDelete: ReferentialAction.Cascade);
 27420                });
 421
 27422            migrationBuilder.CreateIndex(
 27423                name: "IX_AncestorIds_BaseItemEntityId",
 27424                table: "AncestorIds",
 27425                column: "BaseItemEntityId");
 426
 27427            migrationBuilder.CreateIndex(
 27428                name: "IX_AncestorIds_ParentItemId",
 27429                table: "AncestorIds",
 27430                column: "ParentItemId");
 431
 27432            migrationBuilder.CreateIndex(
 27433                name: "IX_BaseItemImageInfos_ItemId",
 27434                table: "BaseItemImageInfos",
 27435                column: "ItemId");
 436
 27437            migrationBuilder.CreateIndex(
 27438                name: "IX_BaseItemMetadataFields_ItemId",
 27439                table: "BaseItemMetadataFields",
 27440                column: "ItemId");
 441
 27442            migrationBuilder.CreateIndex(
 27443                name: "IX_BaseItemProviders_ProviderId_ProviderValue_ItemId",
 27444                table: "BaseItemProviders",
 27445                columns: new[] { "ProviderId", "ProviderValue", "ItemId" });
 446
 27447            migrationBuilder.CreateIndex(
 27448                name: "IX_BaseItems_Id_Type_IsFolder_IsVirtualItem",
 27449                table: "BaseItems",
 27450                columns: new[] { "Id", "Type", "IsFolder", "IsVirtualItem" });
 451
 27452            migrationBuilder.CreateIndex(
 27453                name: "IX_BaseItems_IsFolder_TopParentId_IsVirtualItem_PresentationUniqueKey_DateCreated",
 27454                table: "BaseItems",
 27455                columns: new[] { "IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated" });
 456
 27457            migrationBuilder.CreateIndex(
 27458                name: "IX_BaseItems_MediaType_TopParentId_IsVirtualItem_PresentationUniqueKey",
 27459                table: "BaseItems",
 27460                columns: new[] { "MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey" });
 461
 27462            migrationBuilder.CreateIndex(
 27463                name: "IX_BaseItems_ParentId",
 27464                table: "BaseItems",
 27465                column: "ParentId");
 466
 27467            migrationBuilder.CreateIndex(
 27468                name: "IX_BaseItems_Path",
 27469                table: "BaseItems",
 27470                column: "Path");
 471
 27472            migrationBuilder.CreateIndex(
 27473                name: "IX_BaseItems_PresentationUniqueKey",
 27474                table: "BaseItems",
 27475                column: "PresentationUniqueKey");
 476
 27477            migrationBuilder.CreateIndex(
 27478                name: "IX_BaseItems_TopParentId_Id",
 27479                table: "BaseItems",
 27480                columns: new[] { "TopParentId", "Id" });
 481
 27482            migrationBuilder.CreateIndex(
 27483                name: "IX_BaseItems_Type_SeriesPresentationUniqueKey_IsFolder_IsVirtualItem",
 27484                table: "BaseItems",
 27485                columns: new[] { "Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem" });
 486
 27487            migrationBuilder.CreateIndex(
 27488                name: "IX_BaseItems_Type_SeriesPresentationUniqueKey_PresentationUniqueKey_SortName",
 27489                table: "BaseItems",
 27490                columns: new[] { "Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName" });
 491
 27492            migrationBuilder.CreateIndex(
 27493                name: "IX_BaseItems_Type_TopParentId_Id",
 27494                table: "BaseItems",
 27495                columns: new[] { "Type", "TopParentId", "Id" });
 496
 27497            migrationBuilder.CreateIndex(
 27498                name: "IX_BaseItems_Type_TopParentId_IsVirtualItem_PresentationUniqueKey_DateCreated",
 27499                table: "BaseItems",
 27500                columns: new[] { "Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated" });
 501
 27502            migrationBuilder.CreateIndex(
 27503                name: "IX_BaseItems_Type_TopParentId_PresentationUniqueKey",
 27504                table: "BaseItems",
 27505                columns: new[] { "Type", "TopParentId", "PresentationUniqueKey" });
 506
 27507            migrationBuilder.CreateIndex(
 27508                name: "IX_BaseItems_Type_TopParentId_StartDate",
 27509                table: "BaseItems",
 27510                columns: new[] { "Type", "TopParentId", "StartDate" });
 511
 27512            migrationBuilder.CreateIndex(
 27513                name: "IX_BaseItemTrailerTypes_ItemId",
 27514                table: "BaseItemTrailerTypes",
 27515                column: "ItemId");
 516
 27517            migrationBuilder.CreateIndex(
 27518                name: "IX_ItemValues_Type_CleanValue",
 27519                table: "ItemValues",
 27520                columns: new[] { "Type", "CleanValue" });
 521
 27522            migrationBuilder.CreateIndex(
 27523                name: "IX_ItemValuesMap_ItemId",
 27524                table: "ItemValuesMap",
 27525                column: "ItemId");
 526
 27527            migrationBuilder.CreateIndex(
 27528                name: "IX_MediaStreamInfos_StreamIndex",
 27529                table: "MediaStreamInfos",
 27530                column: "StreamIndex");
 531
 27532            migrationBuilder.CreateIndex(
 27533                name: "IX_MediaStreamInfos_StreamIndex_StreamType",
 27534                table: "MediaStreamInfos",
 27535                columns: new[] { "StreamIndex", "StreamType" });
 536
 27537            migrationBuilder.CreateIndex(
 27538                name: "IX_MediaStreamInfos_StreamIndex_StreamType_Language",
 27539                table: "MediaStreamInfos",
 27540                columns: new[] { "StreamIndex", "StreamType", "Language" });
 541
 27542            migrationBuilder.CreateIndex(
 27543                name: "IX_MediaStreamInfos_StreamType",
 27544                table: "MediaStreamInfos",
 27545                column: "StreamType");
 546
 27547            migrationBuilder.CreateIndex(
 27548                name: "IX_PeopleBaseItemMap_ItemId_ListOrder",
 27549                table: "PeopleBaseItemMap",
 27550                columns: new[] { "ItemId", "ListOrder" });
 551
 27552            migrationBuilder.CreateIndex(
 27553                name: "IX_PeopleBaseItemMap_ItemId_SortOrder",
 27554                table: "PeopleBaseItemMap",
 27555                columns: new[] { "ItemId", "SortOrder" });
 556
 27557            migrationBuilder.CreateIndex(
 27558                name: "IX_PeopleBaseItemMap_PeopleId",
 27559                table: "PeopleBaseItemMap",
 27560                column: "PeopleId");
 561
 27562            migrationBuilder.CreateIndex(
 27563                name: "IX_Peoples_Name",
 27564                table: "Peoples",
 27565                column: "Name");
 566
 27567            migrationBuilder.CreateIndex(
 27568                name: "IX_UserData_ItemId_UserId_IsFavorite",
 27569                table: "UserData",
 27570                columns: new[] { "ItemId", "UserId", "IsFavorite" });
 571
 27572            migrationBuilder.CreateIndex(
 27573                name: "IX_UserData_ItemId_UserId_LastPlayedDate",
 27574                table: "UserData",
 27575                columns: new[] { "ItemId", "UserId", "LastPlayedDate" });
 576
 27577            migrationBuilder.CreateIndex(
 27578                name: "IX_UserData_ItemId_UserId_PlaybackPositionTicks",
 27579                table: "UserData",
 27580                columns: new[] { "ItemId", "UserId", "PlaybackPositionTicks" });
 581
 27582            migrationBuilder.CreateIndex(
 27583                name: "IX_UserData_ItemId_UserId_Played",
 27584                table: "UserData",
 27585                columns: new[] { "ItemId", "UserId", "Played" });
 586
 27587            migrationBuilder.CreateIndex(
 27588                name: "IX_UserData_UserId",
 27589                table: "UserData",
 27590                column: "UserId");
 27591        }
 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
 2721            modelBuilder.HasAnnotation("ProductVersion", "8.0.10");
 22
 2723            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 2724                {
 2725                    b.Property<int>("Id")
 2726                        .ValueGeneratedOnAdd()
 2727                        .HasColumnType("INTEGER");
 2728
 2729                    b.Property<int>("DayOfWeek")
 2730                        .HasColumnType("INTEGER");
 2731
 2732                    b.Property<double>("EndHour")
 2733                        .HasColumnType("REAL");
 2734
 2735                    b.Property<double>("StartHour")
 2736                        .HasColumnType("REAL");
 2737
 2738                    b.Property<Guid>("UserId")
 2739                        .HasColumnType("TEXT");
 2740
 2741                    b.HasKey("Id");
 2742
 2743                    b.HasIndex("UserId");
 2744
 2745                    b.ToTable("AccessSchedules");
 2746                });
 47
 2748            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
 2749                {
 2750                    b.Property<int>("Id")
 2751                        .ValueGeneratedOnAdd()
 2752                        .HasColumnType("INTEGER");
 2753
 2754                    b.Property<DateTime>("DateCreated")
 2755                        .HasColumnType("TEXT");
 2756
 2757                    b.Property<string>("ItemId")
 2758                        .HasMaxLength(256)
 2759                        .HasColumnType("TEXT");
 2760
 2761                    b.Property<int>("LogSeverity")
 2762                        .HasColumnType("INTEGER");
 2763
 2764                    b.Property<string>("Name")
 2765                        .IsRequired()
 2766                        .HasMaxLength(512)
 2767                        .HasColumnType("TEXT");
 2768
 2769                    b.Property<string>("Overview")
 2770                        .HasMaxLength(512)
 2771                        .HasColumnType("TEXT");
 2772
 2773                    b.Property<uint>("RowVersion")
 2774                        .IsConcurrencyToken()
 2775                        .HasColumnType("INTEGER");
 2776
 2777                    b.Property<string>("ShortOverview")
 2778                        .HasMaxLength(512)
 2779                        .HasColumnType("TEXT");
 2780
 2781                    b.Property<string>("Type")
 2782                        .IsRequired()
 2783                        .HasMaxLength(256)
 2784                        .HasColumnType("TEXT");
 2785
 2786                    b.Property<Guid>("UserId")
 2787                        .HasColumnType("TEXT");
 2788
 2789                    b.HasKey("Id");
 2790
 2791                    b.HasIndex("DateCreated");
 2792
 2793                    b.ToTable("ActivityLogs");
 2794                });
 95
 2796            modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b =>
 2797                {
 2798                    b.Property<Guid>("ItemId")
 2799                        .HasColumnType("TEXT");
 27100
 27101                    b.Property<Guid>("ParentItemId")
 27102                        .HasColumnType("TEXT");
 27103
 27104                    b.Property<Guid?>("BaseItemEntityId")
 27105                        .HasColumnType("TEXT");
 27106
 27107                    b.HasKey("ItemId", "ParentItemId");
 27108
 27109                    b.HasIndex("BaseItemEntityId");
 27110
 27111                    b.HasIndex("ParentItemId");
 27112
 27113                    b.ToTable("AncestorIds");
 27114                });
 115
 27116            modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b =>
 27117                {
 27118                    b.Property<Guid>("ItemId")
 27119                        .HasColumnType("TEXT");
 27120
 27121                    b.Property<int>("Index")
 27122                        .HasColumnType("INTEGER");
 27123
 27124                    b.Property<string>("Codec")
 27125                        .IsRequired()
 27126                        .HasColumnType("TEXT");
 27127
 27128                    b.Property<string>("CodecTag")
 27129                        .HasColumnType("TEXT");
 27130
 27131                    b.Property<string>("Comment")
 27132                        .HasColumnType("TEXT");
 27133
 27134                    b.Property<string>("Filename")
 27135                        .HasColumnType("TEXT");
 27136
 27137                    b.Property<string>("MimeType")
 27138                        .HasColumnType("TEXT");
 27139
 27140                    b.HasKey("ItemId", "Index");
 27141
 27142                    b.ToTable("AttachmentStreamInfos");
 27143                });
 144
 27145            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b =>
 27146                {
 27147                    b.Property<Guid>("Id")
 27148                        .ValueGeneratedOnAdd()
 27149                        .HasColumnType("TEXT");
 27150
 27151                    b.Property<string>("Album")
 27152                        .HasColumnType("TEXT");
 27153
 27154                    b.Property<string>("AlbumArtists")
 27155                        .HasColumnType("TEXT");
 27156
 27157                    b.Property<string>("Artists")
 27158                        .HasColumnType("TEXT");
 27159
 27160                    b.Property<int?>("Audio")
 27161                        .HasColumnType("INTEGER");
 27162
 27163                    b.Property<string>("ChannelId")
 27164                        .HasColumnType("TEXT");
 27165
 27166                    b.Property<string>("CleanName")
 27167                        .HasColumnType("TEXT");
 27168
 27169                    b.Property<float?>("CommunityRating")
 27170                        .HasColumnType("REAL");
 27171
 27172                    b.Property<float?>("CriticRating")
 27173                        .HasColumnType("REAL");
 27174
 27175                    b.Property<string>("CustomRating")
 27176                        .HasColumnType("TEXT");
 27177
 27178                    b.Property<string>("Data")
 27179                        .HasColumnType("TEXT");
 27180
 27181                    b.Property<DateTime?>("DateCreated")
 27182                        .HasColumnType("TEXT");
 27183
 27184                    b.Property<DateTime?>("DateLastMediaAdded")
 27185                        .HasColumnType("TEXT");
 27186
 27187                    b.Property<DateTime?>("DateLastRefreshed")
 27188                        .HasColumnType("TEXT");
 27189
 27190                    b.Property<DateTime?>("DateLastSaved")
 27191                        .HasColumnType("TEXT");
 27192
 27193                    b.Property<DateTime?>("DateModified")
 27194                        .HasColumnType("TEXT");
 27195
 27196                    b.Property<DateTime>("EndDate")
 27197                        .HasColumnType("TEXT");
 27198
 27199                    b.Property<string>("EpisodeTitle")
 27200                        .HasColumnType("TEXT");
 27201
 27202                    b.Property<string>("ExternalId")
 27203                        .HasColumnType("TEXT");
 27204
 27205                    b.Property<string>("ExternalSeriesId")
 27206                        .HasColumnType("TEXT");
 27207
 27208                    b.Property<string>("ExternalServiceId")
 27209                        .HasColumnType("TEXT");
 27210
 27211                    b.Property<string>("ExtraIds")
 27212                        .HasColumnType("TEXT");
 27213
 27214                    b.Property<int?>("ExtraType")
 27215                        .HasColumnType("INTEGER");
 27216
 27217                    b.Property<string>("ForcedSortName")
 27218                        .HasColumnType("TEXT");
 27219
 27220                    b.Property<string>("Genres")
 27221                        .HasColumnType("TEXT");
 27222
 27223                    b.Property<int?>("Height")
 27224                        .HasColumnType("INTEGER");
 27225
 27226                    b.Property<int?>("IndexNumber")
 27227                        .HasColumnType("INTEGER");
 27228
 27229                    b.Property<int?>("InheritedParentalRatingValue")
 27230                        .HasColumnType("INTEGER");
 27231
 27232                    b.Property<bool>("IsFolder")
 27233                        .HasColumnType("INTEGER");
 27234
 27235                    b.Property<bool>("IsInMixedFolder")
 27236                        .HasColumnType("INTEGER");
 27237
 27238                    b.Property<bool>("IsLocked")
 27239                        .HasColumnType("INTEGER");
 27240
 27241                    b.Property<bool>("IsMovie")
 27242                        .HasColumnType("INTEGER");
 27243
 27244                    b.Property<bool>("IsRepeat")
 27245                        .HasColumnType("INTEGER");
 27246
 27247                    b.Property<bool>("IsSeries")
 27248                        .HasColumnType("INTEGER");
 27249
 27250                    b.Property<bool>("IsVirtualItem")
 27251                        .HasColumnType("INTEGER");
 27252
 27253                    b.Property<float?>("LUFS")
 27254                        .HasColumnType("REAL");
 27255
 27256                    b.Property<string>("MediaType")
 27257                        .HasColumnType("TEXT");
 27258
 27259                    b.Property<string>("Name")
 27260                        .HasColumnType("TEXT");
 27261
 27262                    b.Property<float?>("NormalizationGain")
 27263                        .HasColumnType("REAL");
 27264
 27265                    b.Property<string>("OfficialRating")
 27266                        .HasColumnType("TEXT");
 27267
 27268                    b.Property<string>("OriginalTitle")
 27269                        .HasColumnType("TEXT");
 27270
 27271                    b.Property<string>("Overview")
 27272                        .HasColumnType("TEXT");
 27273
 27274                    b.Property<string>("OwnerId")
 27275                        .HasColumnType("TEXT");
 27276
 27277                    b.Property<Guid?>("ParentId")
 27278                        .HasColumnType("TEXT");
 27279
 27280                    b.Property<int?>("ParentIndexNumber")
 27281                        .HasColumnType("INTEGER");
 27282
 27283                    b.Property<string>("Path")
 27284                        .HasColumnType("TEXT");
 27285
 27286                    b.Property<string>("PreferredMetadataCountryCode")
 27287                        .HasColumnType("TEXT");
 27288
 27289                    b.Property<string>("PreferredMetadataLanguage")
 27290                        .HasColumnType("TEXT");
 27291
 27292                    b.Property<DateTime?>("PremiereDate")
 27293                        .HasColumnType("TEXT");
 27294
 27295                    b.Property<string>("PresentationUniqueKey")
 27296                        .HasColumnType("TEXT");
 27297
 27298                    b.Property<string>("PrimaryVersionId")
 27299                        .HasColumnType("TEXT");
 27300
 27301                    b.Property<string>("ProductionLocations")
 27302                        .HasColumnType("TEXT");
 27303
 27304                    b.Property<int?>("ProductionYear")
 27305                        .HasColumnType("INTEGER");
 27306
 27307                    b.Property<long?>("RunTimeTicks")
 27308                        .HasColumnType("INTEGER");
 27309
 27310                    b.Property<Guid?>("SeasonId")
 27311                        .HasColumnType("TEXT");
 27312
 27313                    b.Property<string>("SeasonName")
 27314                        .HasColumnType("TEXT");
 27315
 27316                    b.Property<Guid?>("SeriesId")
 27317                        .HasColumnType("TEXT");
 27318
 27319                    b.Property<string>("SeriesName")
 27320                        .HasColumnType("TEXT");
 27321
 27322                    b.Property<string>("SeriesPresentationUniqueKey")
 27323                        .HasColumnType("TEXT");
 27324
 27325                    b.Property<string>("ShowId")
 27326                        .HasColumnType("TEXT");
 27327
 27328                    b.Property<long?>("Size")
 27329                        .HasColumnType("INTEGER");
 27330
 27331                    b.Property<string>("SortName")
 27332                        .HasColumnType("TEXT");
 27333
 27334                    b.Property<DateTime>("StartDate")
 27335                        .HasColumnType("TEXT");
 27336
 27337                    b.Property<string>("Studios")
 27338                        .HasColumnType("TEXT");
 27339
 27340                    b.Property<string>("Tagline")
 27341                        .HasColumnType("TEXT");
 27342
 27343                    b.Property<string>("Tags")
 27344                        .HasColumnType("TEXT");
 27345
 27346                    b.Property<Guid?>("TopParentId")
 27347                        .HasColumnType("TEXT");
 27348
 27349                    b.Property<int?>("TotalBitrate")
 27350                        .HasColumnType("INTEGER");
 27351
 27352                    b.Property<string>("Type")
 27353                        .IsRequired()
 27354                        .HasColumnType("TEXT");
 27355
 27356                    b.Property<string>("UnratedType")
 27357                        .HasColumnType("TEXT");
 27358
 27359                    b.Property<int?>("Width")
 27360                        .HasColumnType("INTEGER");
 27361
 27362                    b.HasKey("Id");
 27363
 27364                    b.HasIndex("ParentId");
 27365
 27366                    b.HasIndex("Path");
 27367
 27368                    b.HasIndex("PresentationUniqueKey");
 27369
 27370                    b.HasIndex("TopParentId", "Id");
 27371
 27372                    b.HasIndex("Type", "TopParentId", "Id");
 27373
 27374                    b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
 27375
 27376                    b.HasIndex("Type", "TopParentId", "StartDate");
 27377
 27378                    b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem");
 27379
 27380                    b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey");
 27381
 27382                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem");
 27383
 27384                    b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName");
 27385
 27386                    b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27387
 27388                    b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated");
 27389
 27390                    b.ToTable("BaseItems");
 27391                });
 392
 27393            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b =>
 27394                {
 27395                    b.Property<Guid>("Id")
 27396                        .ValueGeneratedOnAdd()
 27397                        .HasColumnType("TEXT");
 27398
 27399                    b.Property<byte[]>("Blurhash")
 27400                        .HasColumnType("BLOB");
 27401
 27402                    b.Property<DateTime>("DateModified")
 27403                        .HasColumnType("TEXT");
 27404
 27405                    b.Property<int>("Height")
 27406                        .HasColumnType("INTEGER");
 27407
 27408                    b.Property<int>("ImageType")
 27409                        .HasColumnType("INTEGER");
 27410
 27411                    b.Property<Guid>("ItemId")
 27412                        .HasColumnType("TEXT");
 27413
 27414                    b.Property<string>("Path")
 27415                        .IsRequired()
 27416                        .HasColumnType("TEXT");
 27417
 27418                    b.Property<int>("Width")
 27419                        .HasColumnType("INTEGER");
 27420
 27421                    b.HasKey("Id");
 27422
 27423                    b.HasIndex("ItemId");
 27424
 27425                    b.ToTable("BaseItemImageInfos");
 27426                });
 427
 27428            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b =>
 27429                {
 27430                    b.Property<int>("Id")
 27431                        .HasColumnType("INTEGER");
 27432
 27433                    b.Property<Guid>("ItemId")
 27434                        .HasColumnType("TEXT");
 27435
 27436                    b.HasKey("Id", "ItemId");
 27437
 27438                    b.HasIndex("ItemId");
 27439
 27440                    b.ToTable("BaseItemMetadataFields");
 27441                });
 442
 27443            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b =>
 27444                {
 27445                    b.Property<Guid>("ItemId")
 27446                        .HasColumnType("TEXT");
 27447
 27448                    b.Property<string>("ProviderId")
 27449                        .HasColumnType("TEXT");
 27450
 27451                    b.Property<string>("ProviderValue")
 27452                        .IsRequired()
 27453                        .HasColumnType("TEXT");
 27454
 27455                    b.HasKey("ItemId", "ProviderId");
 27456
 27457                    b.HasIndex("ProviderId", "ProviderValue", "ItemId");
 27458
 27459                    b.ToTable("BaseItemProviders");
 27460                });
 461
 27462            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b =>
 27463                {
 27464                    b.Property<int>("Id")
 27465                        .HasColumnType("INTEGER");
 27466
 27467                    b.Property<Guid>("ItemId")
 27468                        .HasColumnType("TEXT");
 27469
 27470                    b.HasKey("Id", "ItemId");
 27471
 27472                    b.HasIndex("ItemId");
 27473
 27474                    b.ToTable("BaseItemTrailerTypes");
 27475                });
 476
 27477            modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b =>
 27478                {
 27479                    b.Property<Guid>("ItemId")
 27480                        .HasColumnType("TEXT");
 27481
 27482                    b.Property<int>("ChapterIndex")
 27483                        .HasColumnType("INTEGER");
 27484
 27485                    b.Property<DateTime?>("ImageDateModified")
 27486                        .HasColumnType("TEXT");
 27487
 27488                    b.Property<string>("ImagePath")
 27489                        .HasColumnType("TEXT");
 27490
 27491                    b.Property<string>("Name")
 27492                        .HasColumnType("TEXT");
 27493
 27494                    b.Property<long>("StartPositionTicks")
 27495                        .HasColumnType("INTEGER");
 27496
 27497                    b.HasKey("ItemId", "ChapterIndex");
 27498
 27499                    b.ToTable("Chapters");
 27500                });
 501
 27502            modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b =>
 27503                {
 27504                    b.Property<int>("Id")
 27505                        .ValueGeneratedOnAdd()
 27506                        .HasColumnType("INTEGER");
 27507
 27508                    b.Property<string>("Client")
 27509                        .IsRequired()
 27510                        .HasMaxLength(32)
 27511                        .HasColumnType("TEXT");
 27512
 27513                    b.Property<Guid>("ItemId")
 27514                        .HasColumnType("TEXT");
 27515
 27516                    b.Property<string>("Key")
 27517                        .IsRequired()
 27518                        .HasColumnType("TEXT");
 27519
 27520                    b.Property<Guid>("UserId")
 27521                        .HasColumnType("TEXT");
 27522
 27523                    b.Property<string>("Value")
 27524                        .HasColumnType("TEXT");
 27525
 27526                    b.HasKey("Id");
 27527
 27528                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 27529                        .IsUnique();
 27530
 27531                    b.ToTable("CustomItemDisplayPreferences");
 27532                });
 533
 27534            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 27535                {
 27536                    b.Property<int>("Id")
 27537                        .ValueGeneratedOnAdd()
 27538                        .HasColumnType("INTEGER");
 27539
 27540                    b.Property<int>("ChromecastVersion")
 27541                        .HasColumnType("INTEGER");
 27542
 27543                    b.Property<string>("Client")
 27544                        .IsRequired()
 27545                        .HasMaxLength(32)
 27546                        .HasColumnType("TEXT");
 27547
 27548                    b.Property<string>("DashboardTheme")
 27549                        .HasMaxLength(32)
 27550                        .HasColumnType("TEXT");
 27551
 27552                    b.Property<bool>("EnableNextVideoInfoOverlay")
 27553                        .HasColumnType("INTEGER");
 27554
 27555                    b.Property<int?>("IndexBy")
 27556                        .HasColumnType("INTEGER");
 27557
 27558                    b.Property<Guid>("ItemId")
 27559                        .HasColumnType("TEXT");
 27560
 27561                    b.Property<int>("ScrollDirection")
 27562                        .HasColumnType("INTEGER");
 27563
 27564                    b.Property<bool>("ShowBackdrop")
 27565                        .HasColumnType("INTEGER");
 27566
 27567                    b.Property<bool>("ShowSidebar")
 27568                        .HasColumnType("INTEGER");
 27569
 27570                    b.Property<int>("SkipBackwardLength")
 27571                        .HasColumnType("INTEGER");
 27572
 27573                    b.Property<int>("SkipForwardLength")
 27574                        .HasColumnType("INTEGER");
 27575
 27576                    b.Property<string>("TvHome")
 27577                        .HasMaxLength(32)
 27578                        .HasColumnType("TEXT");
 27579
 27580                    b.Property<Guid>("UserId")
 27581                        .HasColumnType("TEXT");
 27582
 27583                    b.HasKey("Id");
 27584
 27585                    b.HasIndex("UserId", "ItemId", "Client")
 27586                        .IsUnique();
 27587
 27588                    b.ToTable("DisplayPreferences");
 27589                });
 590
 27591            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 27592                {
 27593                    b.Property<int>("Id")
 27594                        .ValueGeneratedOnAdd()
 27595                        .HasColumnType("INTEGER");
 27596
 27597                    b.Property<int>("DisplayPreferencesId")
 27598                        .HasColumnType("INTEGER");
 27599
 27600                    b.Property<int>("Order")
 27601                        .HasColumnType("INTEGER");
 27602
 27603                    b.Property<int>("Type")
 27604                        .HasColumnType("INTEGER");
 27605
 27606                    b.HasKey("Id");
 27607
 27608                    b.HasIndex("DisplayPreferencesId");
 27609
 27610                    b.ToTable("HomeSection");
 27611                });
 612
 27613            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 27614                {
 27615                    b.Property<int>("Id")
 27616                        .ValueGeneratedOnAdd()
 27617                        .HasColumnType("INTEGER");
 27618
 27619                    b.Property<DateTime>("LastModified")
 27620                        .HasColumnType("TEXT");
 27621
 27622                    b.Property<string>("Path")
 27623                        .IsRequired()
 27624                        .HasMaxLength(512)
 27625                        .HasColumnType("TEXT");
 27626
 27627                    b.Property<Guid?>("UserId")
 27628                        .HasColumnType("TEXT");
 27629
 27630                    b.HasKey("Id");
 27631
 27632                    b.HasIndex("UserId")
 27633                        .IsUnique();
 27634
 27635                    b.ToTable("ImageInfos");
 27636                });
 637
 27638            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 27639                {
 27640                    b.Property<int>("Id")
 27641                        .ValueGeneratedOnAdd()
 27642                        .HasColumnType("INTEGER");
 27643
 27644                    b.Property<string>("Client")
 27645                        .IsRequired()
 27646                        .HasMaxLength(32)
 27647                        .HasColumnType("TEXT");
 27648
 27649                    b.Property<int?>("IndexBy")
 27650                        .HasColumnType("INTEGER");
 27651
 27652                    b.Property<Guid>("ItemId")
 27653                        .HasColumnType("TEXT");
 27654
 27655                    b.Property<bool>("RememberIndexing")
 27656                        .HasColumnType("INTEGER");
 27657
 27658                    b.Property<bool>("RememberSorting")
 27659                        .HasColumnType("INTEGER");
 27660
 27661                    b.Property<string>("SortBy")
 27662                        .IsRequired()
 27663                        .HasMaxLength(64)
 27664                        .HasColumnType("TEXT");
 27665
 27666                    b.Property<int>("SortOrder")
 27667                        .HasColumnType("INTEGER");
 27668
 27669                    b.Property<Guid>("UserId")
 27670                        .HasColumnType("TEXT");
 27671
 27672                    b.Property<int>("ViewType")
 27673                        .HasColumnType("INTEGER");
 27674
 27675                    b.HasKey("Id");
 27676
 27677                    b.HasIndex("UserId");
 27678
 27679                    b.ToTable("ItemDisplayPreferences");
 27680                });
 681
 27682            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b =>
 27683                {
 27684                    b.Property<Guid>("ItemValueId")
 27685                        .ValueGeneratedOnAdd()
 27686                        .HasColumnType("TEXT");
 27687
 27688                    b.Property<string>("CleanValue")
 27689                        .IsRequired()
 27690                        .HasColumnType("TEXT");
 27691
 27692                    b.Property<int>("Type")
 27693                        .HasColumnType("INTEGER");
 27694
 27695                    b.Property<string>("Value")
 27696                        .IsRequired()
 27697                        .HasColumnType("TEXT");
 27698
 27699                    b.HasKey("ItemValueId");
 27700
 27701                    b.HasIndex("Type", "CleanValue");
 27702
 27703                    b.ToTable("ItemValues");
 27704                });
 705
 27706            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b =>
 27707                {
 27708                    b.Property<Guid>("ItemValueId")
 27709                        .HasColumnType("TEXT");
 27710
 27711                    b.Property<Guid>("ItemId")
 27712                        .HasColumnType("TEXT");
 27713
 27714                    b.HasKey("ItemValueId", "ItemId");
 27715
 27716                    b.HasIndex("ItemId");
 27717
 27718                    b.ToTable("ItemValuesMap");
 27719                });
 720
 27721            modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b =>
 27722                {
 27723                    b.Property<Guid>("Id")
 27724                        .ValueGeneratedOnAdd()
 27725                        .HasColumnType("TEXT");
 27726
 27727                    b.Property<long>("EndTicks")
 27728                        .HasColumnType("INTEGER");
 27729
 27730                    b.Property<Guid>("ItemId")
 27731                        .HasColumnType("TEXT");
 27732
 27733                    b.Property<string>("SegmentProviderId")
 27734                        .IsRequired()
 27735                        .HasColumnType("TEXT");
 27736
 27737                    b.Property<long>("StartTicks")
 27738                        .HasColumnType("INTEGER");
 27739
 27740                    b.Property<int>("Type")
 27741                        .HasColumnType("INTEGER");
 27742
 27743                    b.HasKey("Id");
 27744
 27745                    b.ToTable("MediaSegments");
 27746                });
 747
 27748            modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b =>
 27749                {
 27750                    b.Property<Guid>("ItemId")
 27751                        .HasColumnType("TEXT");
 27752
 27753                    b.Property<int>("StreamIndex")
 27754                        .HasColumnType("INTEGER");
 27755
 27756                    b.Property<string>("AspectRatio")
 27757                        .HasColumnType("TEXT");
 27758
 27759                    b.Property<float>("AverageFrameRate")
 27760                        .HasColumnType("REAL");
 27761
 27762                    b.Property<int>("BitDepth")
 27763                        .HasColumnType("INTEGER");
 27764
 27765                    b.Property<int>("BitRate")
 27766                        .HasColumnType("INTEGER");
 27767
 27768                    b.Property<int>("BlPresentFlag")
 27769                        .HasColumnType("INTEGER");
 27770
 27771                    b.Property<string>("ChannelLayout")
 27772                        .HasColumnType("TEXT");
 27773
 27774                    b.Property<int>("Channels")
 27775                        .HasColumnType("INTEGER");
 27776
 27777                    b.Property<string>("Codec")
 27778                        .HasColumnType("TEXT");
 27779
 27780                    b.Property<string>("CodecTag")
 27781                        .IsRequired()
 27782                        .HasColumnType("TEXT");
 27783
 27784                    b.Property<string>("CodecTimeBase")
 27785                        .IsRequired()
 27786                        .HasColumnType("TEXT");
 27787
 27788                    b.Property<string>("ColorPrimaries")
 27789                        .IsRequired()
 27790                        .HasColumnType("TEXT");
 27791
 27792                    b.Property<string>("ColorSpace")
 27793                        .IsRequired()
 27794                        .HasColumnType("TEXT");
 27795
 27796                    b.Property<string>("ColorTransfer")
 27797                        .IsRequired()
 27798                        .HasColumnType("TEXT");
 27799
 27800                    b.Property<string>("Comment")
 27801                        .IsRequired()
 27802                        .HasColumnType("TEXT");
 27803
 27804                    b.Property<int>("DvBlSignalCompatibilityId")
 27805                        .HasColumnType("INTEGER");
 27806
 27807                    b.Property<int>("DvLevel")
 27808                        .HasColumnType("INTEGER");
 27809
 27810                    b.Property<int>("DvProfile")
 27811                        .HasColumnType("INTEGER");
 27812
 27813                    b.Property<int>("DvVersionMajor")
 27814                        .HasColumnType("INTEGER");
 27815
 27816                    b.Property<int>("DvVersionMinor")
 27817                        .HasColumnType("INTEGER");
 27818
 27819                    b.Property<int>("ElPresentFlag")
 27820                        .HasColumnType("INTEGER");
 27821
 27822                    b.Property<int>("Height")
 27823                        .HasColumnType("INTEGER");
 27824
 27825                    b.Property<bool>("IsAnamorphic")
 27826                        .HasColumnType("INTEGER");
 27827
 27828                    b.Property<bool>("IsAvc")
 27829                        .HasColumnType("INTEGER");
 27830
 27831                    b.Property<bool>("IsDefault")
 27832                        .HasColumnType("INTEGER");
 27833
 27834                    b.Property<bool>("IsExternal")
 27835                        .HasColumnType("INTEGER");
 27836
 27837                    b.Property<bool>("IsForced")
 27838                        .HasColumnType("INTEGER");
 27839
 27840                    b.Property<bool>("IsHearingImpaired")
 27841                        .HasColumnType("INTEGER");
 27842
 27843                    b.Property<bool>("IsInterlaced")
 27844                        .HasColumnType("INTEGER");
 27845
 27846                    b.Property<string>("KeyFrames")
 27847                        .HasColumnType("TEXT");
 27848
 27849                    b.Property<string>("Language")
 27850                        .HasColumnType("TEXT");
 27851
 27852                    b.Property<float>("Level")
 27853                        .HasColumnType("REAL");
 27854
 27855                    b.Property<string>("NalLengthSize")
 27856                        .IsRequired()
 27857                        .HasColumnType("TEXT");
 27858
 27859                    b.Property<string>("Path")
 27860                        .HasColumnType("TEXT");
 27861
 27862                    b.Property<string>("PixelFormat")
 27863                        .HasColumnType("TEXT");
 27864
 27865                    b.Property<string>("Profile")
 27866                        .HasColumnType("TEXT");
 27867
 27868                    b.Property<float>("RealFrameRate")
 27869                        .HasColumnType("REAL");
 27870
 27871                    b.Property<int>("RefFrames")
 27872                        .HasColumnType("INTEGER");
 27873
 27874                    b.Property<int>("Rotation")
 27875                        .HasColumnType("INTEGER");
 27876
 27877                    b.Property<int>("RpuPresentFlag")
 27878                        .HasColumnType("INTEGER");
 27879
 27880                    b.Property<int>("SampleRate")
 27881                        .HasColumnType("INTEGER");
 27882
 27883                    b.Property<int?>("StreamType")
 27884                        .HasColumnType("INTEGER");
 27885
 27886                    b.Property<string>("TimeBase")
 27887                        .IsRequired()
 27888                        .HasColumnType("TEXT");
 27889
 27890                    b.Property<string>("Title")
 27891                        .IsRequired()
 27892                        .HasColumnType("TEXT");
 27893
 27894                    b.Property<int>("Width")
 27895                        .HasColumnType("INTEGER");
 27896
 27897                    b.HasKey("ItemId", "StreamIndex");
 27898
 27899                    b.HasIndex("StreamIndex");
 27900
 27901                    b.HasIndex("StreamType");
 27902
 27903                    b.HasIndex("StreamIndex", "StreamType");
 27904
 27905                    b.HasIndex("StreamIndex", "StreamType", "Language");
 27906
 27907                    b.ToTable("MediaStreamInfos");
 27908                });
 909
 27910            modelBuilder.Entity("Jellyfin.Data.Entities.People", b =>
 27911                {
 27912                    b.Property<Guid>("Id")
 27913                        .ValueGeneratedOnAdd()
 27914                        .HasColumnType("TEXT");
 27915
 27916                    b.Property<string>("Name")
 27917                        .IsRequired()
 27918                        .HasColumnType("TEXT");
 27919
 27920                    b.Property<string>("PersonType")
 27921                        .HasColumnType("TEXT");
 27922
 27923                    b.HasKey("Id");
 27924
 27925                    b.HasIndex("Name");
 27926
 27927                    b.ToTable("Peoples");
 27928                });
 929
 27930            modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b =>
 27931                {
 27932                    b.Property<Guid>("ItemId")
 27933                        .HasColumnType("TEXT");
 27934
 27935                    b.Property<Guid>("PeopleId")
 27936                        .HasColumnType("TEXT");
 27937
 27938                    b.Property<int?>("ListOrder")
 27939                        .HasColumnType("INTEGER");
 27940
 27941                    b.Property<string>("Role")
 27942                        .HasColumnType("TEXT");
 27943
 27944                    b.Property<int?>("SortOrder")
 27945                        .HasColumnType("INTEGER");
 27946
 27947                    b.HasKey("ItemId", "PeopleId");
 27948
 27949                    b.HasIndex("PeopleId");
 27950
 27951                    b.HasIndex("ItemId", "ListOrder");
 27952
 27953                    b.HasIndex("ItemId", "SortOrder");
 27954
 27955                    b.ToTable("PeopleBaseItemMap");
 27956                });
 957
 27958            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 27959                {
 27960                    b.Property<int>("Id")
 27961                        .ValueGeneratedOnAdd()
 27962                        .HasColumnType("INTEGER");
 27963
 27964                    b.Property<int>("Kind")
 27965                        .HasColumnType("INTEGER");
 27966
 27967                    b.Property<Guid?>("Permission_Permissions_Guid")
 27968                        .HasColumnType("TEXT");
 27969
 27970                    b.Property<uint>("RowVersion")
 27971                        .IsConcurrencyToken()
 27972                        .HasColumnType("INTEGER");
 27973
 27974                    b.Property<Guid?>("UserId")
 27975                        .HasColumnType("TEXT");
 27976
 27977                    b.Property<bool>("Value")
 27978                        .HasColumnType("INTEGER");
 27979
 27980                    b.HasKey("Id");
 27981
 27982                    b.HasIndex("UserId", "Kind")
 27983                        .IsUnique()
 27984                        .HasFilter("[UserId] IS NOT NULL");
 27985
 27986                    b.ToTable("Permissions");
 27987                });
 988
 27989            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 27990                {
 27991                    b.Property<int>("Id")
 27992                        .ValueGeneratedOnAdd()
 27993                        .HasColumnType("INTEGER");
 27994
 27995                    b.Property<int>("Kind")
 27996                        .HasColumnType("INTEGER");
 27997
 27998                    b.Property<Guid?>("Preference_Preferences_Guid")
 27999                        .HasColumnType("TEXT");
 271000
 271001                    b.Property<uint>("RowVersion")
 271002                        .IsConcurrencyToken()
 271003                        .HasColumnType("INTEGER");
 271004
 271005                    b.Property<Guid?>("UserId")
 271006                        .HasColumnType("TEXT");
 271007
 271008                    b.Property<string>("Value")
 271009                        .IsRequired()
 271010                        .HasMaxLength(65535)
 271011                        .HasColumnType("TEXT");
 271012
 271013                    b.HasKey("Id");
 271014
 271015                    b.HasIndex("UserId", "Kind")
 271016                        .IsUnique()
 271017                        .HasFilter("[UserId] IS NOT NULL");
 271018
 271019                    b.ToTable("Preferences");
 271020                });
 1021
 271022            modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b =>
 271023                {
 271024                    b.Property<int>("Id")
 271025                        .ValueGeneratedOnAdd()
 271026                        .HasColumnType("INTEGER");
 271027
 271028                    b.Property<string>("AccessToken")
 271029                        .IsRequired()
 271030                        .HasColumnType("TEXT");
 271031
 271032                    b.Property<DateTime>("DateCreated")
 271033                        .HasColumnType("TEXT");
 271034
 271035                    b.Property<DateTime>("DateLastActivity")
 271036                        .HasColumnType("TEXT");
 271037
 271038                    b.Property<string>("Name")
 271039                        .IsRequired()
 271040                        .HasMaxLength(64)
 271041                        .HasColumnType("TEXT");
 271042
 271043                    b.HasKey("Id");
 271044
 271045                    b.HasIndex("AccessToken")
 271046                        .IsUnique();
 271047
 271048                    b.ToTable("ApiKeys");
 271049                });
 1050
 271051            modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b =>
 271052                {
 271053                    b.Property<int>("Id")
 271054                        .ValueGeneratedOnAdd()
 271055                        .HasColumnType("INTEGER");
 271056
 271057                    b.Property<string>("AccessToken")
 271058                        .IsRequired()
 271059                        .HasColumnType("TEXT");
 271060
 271061                    b.Property<string>("AppName")
 271062                        .IsRequired()
 271063                        .HasMaxLength(64)
 271064                        .HasColumnType("TEXT");
 271065
 271066                    b.Property<string>("AppVersion")
 271067                        .IsRequired()
 271068                        .HasMaxLength(32)
 271069                        .HasColumnType("TEXT");
 271070
 271071                    b.Property<DateTime>("DateCreated")
 271072                        .HasColumnType("TEXT");
 271073
 271074                    b.Property<DateTime>("DateLastActivity")
 271075                        .HasColumnType("TEXT");
 271076
 271077                    b.Property<DateTime>("DateModified")
 271078                        .HasColumnType("TEXT");
 271079
 271080                    b.Property<string>("DeviceId")
 271081                        .IsRequired()
 271082                        .HasMaxLength(256)
 271083                        .HasColumnType("TEXT");
 271084
 271085                    b.Property<string>("DeviceName")
 271086                        .IsRequired()
 271087                        .HasMaxLength(64)
 271088                        .HasColumnType("TEXT");
 271089
 271090                    b.Property<bool>("IsActive")
 271091                        .HasColumnType("INTEGER");
 271092
 271093                    b.Property<Guid>("UserId")
 271094                        .HasColumnType("TEXT");
 271095
 271096                    b.HasKey("Id");
 271097
 271098                    b.HasIndex("DeviceId");
 271099
 271100                    b.HasIndex("AccessToken", "DateLastActivity");
 271101
 271102                    b.HasIndex("DeviceId", "DateLastActivity");
 271103
 271104                    b.HasIndex("UserId", "DeviceId");
 271105
 271106                    b.ToTable("Devices");
 271107                });
 1108
 271109            modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b =>
 271110                {
 271111                    b.Property<int>("Id")
 271112                        .ValueGeneratedOnAdd()
 271113                        .HasColumnType("INTEGER");
 271114
 271115                    b.Property<string>("CustomName")
 271116                        .HasColumnType("TEXT");
 271117
 271118                    b.Property<string>("DeviceId")
 271119                        .IsRequired()
 271120                        .HasColumnType("TEXT");
 271121
 271122                    b.HasKey("Id");
 271123
 271124                    b.HasIndex("DeviceId")
 271125                        .IsUnique();
 271126
 271127                    b.ToTable("DeviceOptions");
 271128                });
 1129
 271130            modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b =>
 271131                {
 271132                    b.Property<Guid>("ItemId")
 271133                        .HasColumnType("TEXT");
 271134
 271135                    b.Property<int>("Width")
 271136                        .HasColumnType("INTEGER");
 271137
 271138                    b.Property<int>("Bandwidth")
 271139                        .HasColumnType("INTEGER");
 271140
 271141                    b.Property<int>("Height")
 271142                        .HasColumnType("INTEGER");
 271143
 271144                    b.Property<int>("Interval")
 271145                        .HasColumnType("INTEGER");
 271146
 271147                    b.Property<int>("ThumbnailCount")
 271148                        .HasColumnType("INTEGER");
 271149
 271150                    b.Property<int>("TileHeight")
 271151                        .HasColumnType("INTEGER");
 271152
 271153                    b.Property<int>("TileWidth")
 271154                        .HasColumnType("INTEGER");
 271155
 271156                    b.HasKey("ItemId", "Width");
 271157
 271158                    b.ToTable("TrickplayInfos");
 271159                });
 1160
 271161            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 271162                {
 271163                    b.Property<Guid>("Id")
 271164                        .ValueGeneratedOnAdd()
 271165                        .HasColumnType("TEXT");
 271166
 271167                    b.Property<string>("AudioLanguagePreference")
 271168                        .HasMaxLength(255)
 271169                        .HasColumnType("TEXT");
 271170
 271171                    b.Property<string>("AuthenticationProviderId")
 271172                        .IsRequired()
 271173                        .HasMaxLength(255)
 271174                        .HasColumnType("TEXT");
 271175
 271176                    b.Property<string>("CastReceiverId")
 271177                        .HasMaxLength(32)
 271178                        .HasColumnType("TEXT");
 271179
 271180                    b.Property<bool>("DisplayCollectionsView")
 271181                        .HasColumnType("INTEGER");
 271182
 271183                    b.Property<bool>("DisplayMissingEpisodes")
 271184                        .HasColumnType("INTEGER");
 271185
 271186                    b.Property<bool>("EnableAutoLogin")
 271187                        .HasColumnType("INTEGER");
 271188
 271189                    b.Property<bool>("EnableLocalPassword")
 271190                        .HasColumnType("INTEGER");
 271191
 271192                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 271193                        .HasColumnType("INTEGER");
 271194
 271195                    b.Property<bool>("EnableUserPreferenceAccess")
 271196                        .HasColumnType("INTEGER");
 271197
 271198                    b.Property<bool>("HidePlayedInLatest")
 271199                        .HasColumnType("INTEGER");
 271200
 271201                    b.Property<long>("InternalId")
 271202                        .HasColumnType("INTEGER");
 271203
 271204                    b.Property<int>("InvalidLoginAttemptCount")
 271205                        .HasColumnType("INTEGER");
 271206
 271207                    b.Property<DateTime?>("LastActivityDate")
 271208                        .HasColumnType("TEXT");
 271209
 271210                    b.Property<DateTime?>("LastLoginDate")
 271211                        .HasColumnType("TEXT");
 271212
 271213                    b.Property<int?>("LoginAttemptsBeforeLockout")
 271214                        .HasColumnType("INTEGER");
 271215
 271216                    b.Property<int>("MaxActiveSessions")
 271217                        .HasColumnType("INTEGER");
 271218
 271219                    b.Property<int?>("MaxParentalAgeRating")
 271220                        .HasColumnType("INTEGER");
 271221
 271222                    b.Property<bool>("MustUpdatePassword")
 271223                        .HasColumnType("INTEGER");
 271224
 271225                    b.Property<string>("Password")
 271226                        .HasMaxLength(65535)
 271227                        .HasColumnType("TEXT");
 271228
 271229                    b.Property<string>("PasswordResetProviderId")
 271230                        .IsRequired()
 271231                        .HasMaxLength(255)
 271232                        .HasColumnType("TEXT");
 271233
 271234                    b.Property<bool>("PlayDefaultAudioTrack")
 271235                        .HasColumnType("INTEGER");
 271236
 271237                    b.Property<bool>("RememberAudioSelections")
 271238                        .HasColumnType("INTEGER");
 271239
 271240                    b.Property<bool>("RememberSubtitleSelections")
 271241                        .HasColumnType("INTEGER");
 271242
 271243                    b.Property<int?>("RemoteClientBitrateLimit")
 271244                        .HasColumnType("INTEGER");
 271245
 271246                    b.Property<uint>("RowVersion")
 271247                        .IsConcurrencyToken()
 271248                        .HasColumnType("INTEGER");
 271249
 271250                    b.Property<string>("SubtitleLanguagePreference")
 271251                        .HasMaxLength(255)
 271252                        .HasColumnType("TEXT");
 271253
 271254                    b.Property<int>("SubtitleMode")
 271255                        .HasColumnType("INTEGER");
 271256
 271257                    b.Property<int>("SyncPlayAccess")
 271258                        .HasColumnType("INTEGER");
 271259
 271260                    b.Property<string>("Username")
 271261                        .IsRequired()
 271262                        .HasMaxLength(255)
 271263                        .HasColumnType("TEXT")
 271264                        .UseCollation("NOCASE");
 271265
 271266                    b.HasKey("Id");
 271267
 271268                    b.HasIndex("Username")
 271269                        .IsUnique();
 271270
 271271                    b.ToTable("Users");
 271272                });
 1273
 271274            modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
 271275                {
 271276                    b.Property<Guid>("ItemId")
 271277                        .HasColumnType("TEXT");
 271278
 271279                    b.Property<Guid>("UserId")
 271280                        .HasColumnType("TEXT");
 271281
 271282                    b.Property<int?>("AudioStreamIndex")
 271283                        .HasColumnType("INTEGER");
 271284
 271285                    b.Property<bool>("IsFavorite")
 271286                        .HasColumnType("INTEGER");
 271287
 271288                    b.Property<DateTime?>("LastPlayedDate")
 271289                        .HasColumnType("TEXT");
 271290
 271291                    b.Property<bool?>("Likes")
 271292                        .HasColumnType("INTEGER");
 271293
 271294                    b.Property<int>("PlayCount")
 271295                        .HasColumnType("INTEGER");
 271296
 271297                    b.Property<long>("PlaybackPositionTicks")
 271298                        .HasColumnType("INTEGER");
 271299
 271300                    b.Property<bool>("Played")
 271301                        .HasColumnType("INTEGER");
 271302
 271303                    b.Property<double?>("Rating")
 271304                        .HasColumnType("REAL");
 271305
 271306                    b.Property<int?>("SubtitleStreamIndex")
 271307                        .HasColumnType("INTEGER");
 271308
 271309                    b.HasKey("ItemId", "UserId");
 271310
 271311                    b.HasIndex("UserId");
 271312
 271313                    b.HasIndex("ItemId", "UserId", "IsFavorite");
 271314
 271315                    b.HasIndex("ItemId", "UserId", "LastPlayedDate");
 271316
 271317                    b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
 271318
 271319                    b.HasIndex("ItemId", "UserId", "Played");
 271320
 271321                    b.ToTable("UserData");
 271322                });
 1323
 271324            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 271325                {
 271326                    b.HasOne("Jellyfin.Data.Entities.User", null)
 271327                        .WithMany("AccessSchedules")
 271328                        .HasForeignKey("UserId")
 271329                        .OnDelete(DeleteBehavior.Cascade)
 271330                        .IsRequired();
 271331                });
 1332
 271333            modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b =>
 271334                {
 271335                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", null)
 271336                        .WithMany("AncestorIds")
 271337                        .HasForeignKey("BaseItemEntityId");
 271338
 271339                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271340                        .WithMany()
 271341                        .HasForeignKey("ItemId")
 271342                        .OnDelete(DeleteBehavior.Cascade)
 271343                        .IsRequired();
 271344
 271345                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem")
 271346                        .WithMany()
 271347                        .HasForeignKey("ParentItemId")
 271348                        .OnDelete(DeleteBehavior.Cascade)
 271349                        .IsRequired();
 271350
 271351                    b.Navigation("Item");
 271352
 271353                    b.Navigation("ParentItem");
 271354                });
 1355
 271356            modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b =>
 271357                {
 271358                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271359                        .WithMany()
 271360                        .HasForeignKey("ItemId")
 271361                        .OnDelete(DeleteBehavior.Cascade)
 271362                        .IsRequired();
 271363
 271364                    b.Navigation("Item");
 271365                });
 1366
 271367            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b =>
 271368                {
 271369                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271370                        .WithMany("Images")
 271371                        .HasForeignKey("ItemId")
 271372                        .OnDelete(DeleteBehavior.Cascade)
 271373                        .IsRequired();
 271374
 271375                    b.Navigation("Item");
 271376                });
 1377
 271378            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b =>
 271379                {
 271380                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271381                        .WithMany("LockedFields")
 271382                        .HasForeignKey("ItemId")
 271383                        .OnDelete(DeleteBehavior.Cascade)
 271384                        .IsRequired();
 271385
 271386                    b.Navigation("Item");
 271387                });
 1388
 271389            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b =>
 271390                {
 271391                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271392                        .WithMany("Provider")
 271393                        .HasForeignKey("ItemId")
 271394                        .OnDelete(DeleteBehavior.Cascade)
 271395                        .IsRequired();
 271396
 271397                    b.Navigation("Item");
 271398                });
 1399
 271400            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b =>
 271401                {
 271402                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271403                        .WithMany("TrailerTypes")
 271404                        .HasForeignKey("ItemId")
 271405                        .OnDelete(DeleteBehavior.Cascade)
 271406                        .IsRequired();
 271407
 271408                    b.Navigation("Item");
 271409                });
 1410
 271411            modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b =>
 271412                {
 271413                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271414                        .WithMany("Chapters")
 271415                        .HasForeignKey("ItemId")
 271416                        .OnDelete(DeleteBehavior.Cascade)
 271417                        .IsRequired();
 271418
 271419                    b.Navigation("Item");
 271420                });
 1421
 271422            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 271423                {
 271424                    b.HasOne("Jellyfin.Data.Entities.User", null)
 271425                        .WithMany("DisplayPreferences")
 271426                        .HasForeignKey("UserId")
 271427                        .OnDelete(DeleteBehavior.Cascade)
 271428                        .IsRequired();
 271429                });
 1430
 271431            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 271432                {
 271433                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 271434                        .WithMany("HomeSections")
 271435                        .HasForeignKey("DisplayPreferencesId")
 271436                        .OnDelete(DeleteBehavior.Cascade)
 271437                        .IsRequired();
 271438                });
 1439
 271440            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 271441                {
 271442                    b.HasOne("Jellyfin.Data.Entities.User", null)
 271443                        .WithOne("ProfileImage")
 271444                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId")
 271445                        .OnDelete(DeleteBehavior.Cascade);
 271446                });
 1447
 271448            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 271449                {
 271450                    b.HasOne("Jellyfin.Data.Entities.User", null)
 271451                        .WithMany("ItemDisplayPreferences")
 271452                        .HasForeignKey("UserId")
 271453                        .OnDelete(DeleteBehavior.Cascade)
 271454                        .IsRequired();
 271455                });
 1456
 271457            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b =>
 271458                {
 271459                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271460                        .WithMany("ItemValues")
 271461                        .HasForeignKey("ItemId")
 271462                        .OnDelete(DeleteBehavior.Cascade)
 271463                        .IsRequired();
 271464
 271465                    b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue")
 271466                        .WithMany("BaseItemsMap")
 271467                        .HasForeignKey("ItemValueId")
 271468                        .OnDelete(DeleteBehavior.Cascade)
 271469                        .IsRequired();
 271470
 271471                    b.Navigation("Item");
 271472
 271473                    b.Navigation("ItemValue");
 271474                });
 1475
 271476            modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b =>
 271477                {
 271478                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271479                        .WithMany("MediaStreams")
 271480                        .HasForeignKey("ItemId")
 271481                        .OnDelete(DeleteBehavior.Cascade)
 271482                        .IsRequired();
 271483
 271484                    b.Navigation("Item");
 271485                });
 1486
 271487            modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b =>
 271488                {
 271489                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271490                        .WithMany("Peoples")
 271491                        .HasForeignKey("ItemId")
 271492                        .OnDelete(DeleteBehavior.Cascade)
 271493                        .IsRequired();
 271494
 271495                    b.HasOne("Jellyfin.Data.Entities.People", "People")
 271496                        .WithMany("BaseItems")
 271497                        .HasForeignKey("PeopleId")
 271498                        .OnDelete(DeleteBehavior.Cascade)
 271499                        .IsRequired();
 271500
 271501                    b.Navigation("Item");
 271502
 271503                    b.Navigation("People");
 271504                });
 1505
 271506            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 271507                {
 271508                    b.HasOne("Jellyfin.Data.Entities.User", null)
 271509                        .WithMany("Permissions")
 271510                        .HasForeignKey("UserId")
 271511                        .OnDelete(DeleteBehavior.Cascade);
 271512                });
 1513
 271514            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 271515                {
 271516                    b.HasOne("Jellyfin.Data.Entities.User", null)
 271517                        .WithMany("Preferences")
 271518                        .HasForeignKey("UserId")
 271519                        .OnDelete(DeleteBehavior.Cascade);
 271520                });
 1521
 271522            modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b =>
 271523                {
 271524                    b.HasOne("Jellyfin.Data.Entities.User", "User")
 271525                        .WithMany()
 271526                        .HasForeignKey("UserId")
 271527                        .OnDelete(DeleteBehavior.Cascade)
 271528                        .IsRequired();
 271529
 271530                    b.Navigation("User");
 271531                });
 1532
 271533            modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
 271534                {
 271535                    b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
 271536                        .WithMany("UserData")
 271537                        .HasForeignKey("ItemId")
 271538                        .OnDelete(DeleteBehavior.Cascade)
 271539                        .IsRequired();
 271540
 271541                    b.HasOne("Jellyfin.Data.Entities.User", "User")
 271542                        .WithMany()
 271543                        .HasForeignKey("UserId")
 271544                        .OnDelete(DeleteBehavior.Cascade)
 271545                        .IsRequired();
 271546
 271547                    b.Navigation("Item");
 271548
 271549                    b.Navigation("User");
 271550                });
 1551
 271552            modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b =>
 271553                {
 271554                    b.Navigation("AncestorIds");
 271555
 271556                    b.Navigation("Chapters");
 271557
 271558                    b.Navigation("Images");
 271559
 271560                    b.Navigation("ItemValues");
 271561
 271562                    b.Navigation("LockedFields");
 271563
 271564                    b.Navigation("MediaStreams");
 271565
 271566                    b.Navigation("Peoples");
 271567
 271568                    b.Navigation("Provider");
 271569
 271570                    b.Navigation("TrailerTypes");
 271571
 271572                    b.Navigation("UserData");
 271573                });
 1574
 271575            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 271576                {
 271577                    b.Navigation("HomeSections");
 271578                });
 1579
 271580            modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b =>
 271581                {
 271582                    b.Navigation("BaseItemsMap");
 271583                });
 1584
 271585            modelBuilder.Entity("Jellyfin.Data.Entities.People", b =>
 271586                {
 271587                    b.Navigation("BaseItems");
 271588                });
 1589
 271590            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 271591                {
 271592                    b.Navigation("AccessSchedules");
 271593
 271594                    b.Navigation("DisplayPreferences");
 271595
 271596                    b.Navigation("ItemDisplayPreferences");
 271597
 271598                    b.Navigation("Permissions");
 271599
 271600                    b.Navigation("Preferences");
 271601
 271602                    b.Navigation("ProfileImage");
 271603                });
 1604#pragma warning restore 612, 618
 271605        }
 1606    }
 1607}