< Summary - Jellyfin

Line coverage
86%
Covered lines: 595
Uncovered lines: 91
Coverable lines: 686
Total lines: 775
Line coverage: 86.7%
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

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/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2#pragma warning disable SA1601
 3
 4using System;
 5using Microsoft.EntityFrameworkCore.Migrations;
 6
 7namespace Jellyfin.Server.Implementations.Migrations
 8{
 9    public partial class AddIndexesAndCollations : Migration
 10    {
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 2213            migrationBuilder.DropForeignKey(
 2214                name: "FK_ImageInfos_Users_UserId",
 2215                schema: "jellyfin",
 2216                table: "ImageInfos");
 17
 2218            migrationBuilder.DropForeignKey(
 2219                name: "FK_Permissions_Users_Permission_Permissions_Guid",
 2220                schema: "jellyfin",
 2221                table: "Permissions");
 22
 2223            migrationBuilder.DropForeignKey(
 2224                name: "FK_Preferences_Users_Preference_Preferences_Guid",
 2225                schema: "jellyfin",
 2226                table: "Preferences");
 27
 2228            migrationBuilder.DropIndex(
 2229                name: "IX_Preferences_Preference_Preferences_Guid",
 2230                schema: "jellyfin",
 2231                table: "Preferences");
 32
 2233            migrationBuilder.DropIndex(
 2234                name: "IX_Permissions_Permission_Permissions_Guid",
 2235                schema: "jellyfin",
 2236                table: "Permissions");
 37
 2238            migrationBuilder.DropIndex(
 2239                name: "IX_DisplayPreferences_UserId",
 2240                schema: "jellyfin",
 2241                table: "DisplayPreferences");
 42
 2243            migrationBuilder.DropIndex(
 2244                name: "IX_CustomItemDisplayPreferences_UserId",
 2245                schema: "jellyfin",
 2246                table: "CustomItemDisplayPreferences");
 47
 2248            migrationBuilder.AlterColumn<string>(
 2249                name: "Username",
 2250                schema: "jellyfin",
 2251                table: "Users",
 2252                type: "TEXT",
 2253                maxLength: 255,
 2254                nullable: false,
 2255                collation: "NOCASE",
 2256                oldClrType: typeof(string),
 2257                oldType: "TEXT",
 2258                oldMaxLength: 255);
 59
 2260            migrationBuilder.AddColumn<Guid>(
 2261                name: "UserId",
 2262                schema: "jellyfin",
 2263                table: "Preferences",
 2264                type: "TEXT",
 2265                nullable: true);
 66
 2267            migrationBuilder.AddColumn<Guid>(
 2268                name: "UserId",
 2269                schema: "jellyfin",
 2270                table: "Permissions",
 2271                type: "TEXT",
 2272                nullable: true);
 73
 2274            migrationBuilder.Sql("UPDATE Preferences SET UserId = Preference_Preferences_Guid");
 2275            migrationBuilder.Sql("UPDATE Permissions SET UserId = Permission_Permissions_Guid");
 76
 2277            migrationBuilder.CreateIndex(
 2278                name: "IX_Users_Username",
 2279                schema: "jellyfin",
 2280                table: "Users",
 2281                column: "Username",
 2282                unique: true);
 83
 2284            migrationBuilder.CreateIndex(
 2285                name: "IX_Preferences_UserId_Kind",
 2286                schema: "jellyfin",
 2287                table: "Preferences",
 2288                columns: new[] { "UserId", "Kind" },
 2289                unique: true,
 2290                filter: "[UserId] IS NOT NULL");
 91
 2292            migrationBuilder.CreateIndex(
 2293                name: "IX_Permissions_UserId_Kind",
 2294                schema: "jellyfin",
 2295                table: "Permissions",
 2296                columns: new[] { "UserId", "Kind" },
 2297                unique: true,
 2298                filter: "[UserId] IS NOT NULL");
 99
 22100            migrationBuilder.AddForeignKey(
 22101                name: "FK_ImageInfos_Users_UserId",
 22102                schema: "jellyfin",
 22103                table: "ImageInfos",
 22104                column: "UserId",
 22105                principalSchema: "jellyfin",
 22106                principalTable: "Users",
 22107                principalColumn: "Id",
 22108                onDelete: ReferentialAction.Cascade);
 109
 22110            migrationBuilder.AddForeignKey(
 22111                name: "FK_Permissions_Users_UserId",
 22112                schema: "jellyfin",
 22113                table: "Permissions",
 22114                column: "UserId",
 22115                principalSchema: "jellyfin",
 22116                principalTable: "Users",
 22117                principalColumn: "Id",
 22118                onDelete: ReferentialAction.Cascade);
 119
 22120            migrationBuilder.AddForeignKey(
 22121                name: "FK_Preferences_Users_UserId",
 22122                schema: "jellyfin",
 22123                table: "Preferences",
 22124                column: "UserId",
 22125                principalSchema: "jellyfin",
 22126                principalTable: "Users",
 22127                principalColumn: "Id",
 22128                onDelete: ReferentialAction.Cascade);
 22129        }
 130
 131        protected override void Down(MigrationBuilder migrationBuilder)
 132        {
 0133            migrationBuilder.DropForeignKey(
 0134                name: "FK_ImageInfos_Users_UserId",
 0135                schema: "jellyfin",
 0136                table: "ImageInfos");
 137
 0138            migrationBuilder.DropForeignKey(
 0139                name: "FK_Permissions_Users_UserId",
 0140                schema: "jellyfin",
 0141                table: "Permissions");
 142
 0143            migrationBuilder.DropForeignKey(
 0144                name: "FK_Preferences_Users_UserId",
 0145                schema: "jellyfin",
 0146                table: "Preferences");
 147
 0148            migrationBuilder.DropIndex(
 0149                name: "IX_Users_Username",
 0150                schema: "jellyfin",
 0151                table: "Users");
 152
 0153            migrationBuilder.DropIndex(
 0154                name: "IX_Preferences_UserId_Kind",
 0155                schema: "jellyfin",
 0156                table: "Preferences");
 157
 0158            migrationBuilder.DropIndex(
 0159                name: "IX_Permissions_UserId_Kind",
 0160                schema: "jellyfin",
 0161                table: "Permissions");
 162
 0163            migrationBuilder.DropColumn(
 0164                name: "UserId",
 0165                schema: "jellyfin",
 0166                table: "Preferences");
 167
 0168            migrationBuilder.DropColumn(
 0169                name: "UserId",
 0170                schema: "jellyfin",
 0171                table: "Permissions");
 172
 0173            migrationBuilder.AlterColumn<string>(
 0174                name: "Username",
 0175                schema: "jellyfin",
 0176                table: "Users",
 0177                type: "TEXT",
 0178                maxLength: 255,
 0179                nullable: false,
 0180                oldClrType: typeof(string),
 0181                oldType: "TEXT",
 0182                oldMaxLength: 255,
 0183                oldCollation: "NOCASE");
 184
 0185            migrationBuilder.CreateIndex(
 0186                name: "IX_Preferences_Preference_Preferences_Guid",
 0187                schema: "jellyfin",
 0188                table: "Preferences",
 0189                column: "Preference_Preferences_Guid");
 190
 0191            migrationBuilder.CreateIndex(
 0192                name: "IX_Permissions_Permission_Permissions_Guid",
 0193                schema: "jellyfin",
 0194                table: "Permissions",
 0195                column: "Permission_Permissions_Guid");
 196
 0197            migrationBuilder.CreateIndex(
 0198                name: "IX_DisplayPreferences_UserId",
 0199                schema: "jellyfin",
 0200                table: "DisplayPreferences",
 0201                column: "UserId");
 202
 0203            migrationBuilder.CreateIndex(
 0204                name: "IX_CustomItemDisplayPreferences_UserId",
 0205                schema: "jellyfin",
 0206                table: "CustomItemDisplayPreferences",
 0207                column: "UserId");
 208
 0209            migrationBuilder.AddForeignKey(
 0210                name: "FK_ImageInfos_Users_UserId",
 0211                schema: "jellyfin",
 0212                table: "ImageInfos",
 0213                column: "UserId",
 0214                principalSchema: "jellyfin",
 0215                principalTable: "Users",
 0216                principalColumn: "Id",
 0217                onDelete: ReferentialAction.Restrict);
 218
 0219            migrationBuilder.AddForeignKey(
 0220                name: "FK_Permissions_Users_Permission_Permissions_Guid",
 0221                schema: "jellyfin",
 0222                table: "Permissions",
 0223                column: "Permission_Permissions_Guid",
 0224                principalSchema: "jellyfin",
 0225                principalTable: "Users",
 0226                principalColumn: "Id",
 0227                onDelete: ReferentialAction.Restrict);
 228
 0229            migrationBuilder.AddForeignKey(
 0230                name: "FK_Preferences_Users_Preference_Preferences_Guid",
 0231                schema: "jellyfin",
 0232                table: "Preferences",
 0233                column: "Preference_Preferences_Guid",
 0234                principalSchema: "jellyfin",
 0235                principalTable: "Users",
 0236                principalColumn: "Id",
 0237                onDelete: ReferentialAction.Restrict);
 0238        }
 239    }
 240}

/srv/git/jellyfin/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.Designer.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2
 3// <auto-generated />
 4using System;
 5using Jellyfin.Server.Implementations;
 6using Microsoft.EntityFrameworkCore;
 7using Microsoft.EntityFrameworkCore.Infrastructure;
 8using Microsoft.EntityFrameworkCore.Migrations;
 9using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 10
 11namespace Jellyfin.Server.Implementations.Migrations
 12{
 13    [DbContext(typeof(JellyfinDbContext))]
 14    [Migration("20210320181425_AddIndexesAndCollations")]
 15    partial class AddIndexesAndCollations
 16    {
 17        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 18        {
 19#pragma warning disable 612, 618
 2220            modelBuilder
 2221                .HasDefaultSchema("jellyfin")
 2222                .HasAnnotation("ProductVersion", "5.0.3");
 23
 2224            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 2225                {
 2226                    b.Property<int>("Id")
 2227                        .ValueGeneratedOnAdd()
 2228                        .HasColumnType("INTEGER");
 2229
 2230                    b.Property<int>("DayOfWeek")
 2231                        .HasColumnType("INTEGER");
 2232
 2233                    b.Property<double>("EndHour")
 2234                        .HasColumnType("REAL");
 2235
 2236                    b.Property<double>("StartHour")
 2237                        .HasColumnType("REAL");
 2238
 2239                    b.Property<Guid>("UserId")
 2240                        .HasColumnType("TEXT");
 2241
 2242                    b.HasKey("Id");
 2243
 2244                    b.HasIndex("UserId");
 2245
 2246                    b.ToTable("AccessSchedules");
 2247                });
 48
 2249            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
 2250                {
 2251                    b.Property<int>("Id")
 2252                        .ValueGeneratedOnAdd()
 2253                        .HasColumnType("INTEGER");
 2254
 2255                    b.Property<DateTime>("DateCreated")
 2256                        .HasColumnType("TEXT");
 2257
 2258                    b.Property<string>("ItemId")
 2259                        .HasMaxLength(256)
 2260                        .HasColumnType("TEXT");
 2261
 2262                    b.Property<int>("LogSeverity")
 2263                        .HasColumnType("INTEGER");
 2264
 2265                    b.Property<string>("Name")
 2266                        .IsRequired()
 2267                        .HasMaxLength(512)
 2268                        .HasColumnType("TEXT");
 2269
 2270                    b.Property<string>("Overview")
 2271                        .HasMaxLength(512)
 2272                        .HasColumnType("TEXT");
 2273
 2274                    b.Property<uint>("RowVersion")
 2275                        .IsConcurrencyToken()
 2276                        .HasColumnType("INTEGER");
 2277
 2278                    b.Property<string>("ShortOverview")
 2279                        .HasMaxLength(512)
 2280                        .HasColumnType("TEXT");
 2281
 2282                    b.Property<string>("Type")
 2283                        .IsRequired()
 2284                        .HasMaxLength(256)
 2285                        .HasColumnType("TEXT");
 2286
 2287                    b.Property<Guid>("UserId")
 2288                        .HasColumnType("TEXT");
 2289
 2290                    b.HasKey("Id");
 2291
 2292                    b.ToTable("ActivityLogs");
 2293                });
 94
 2295            modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b =>
 2296                {
 2297                    b.Property<int>("Id")
 2298                        .ValueGeneratedOnAdd()
 2299                        .HasColumnType("INTEGER");
 22100
 22101                    b.Property<string>("Client")
 22102                        .IsRequired()
 22103                        .HasMaxLength(32)
 22104                        .HasColumnType("TEXT");
 22105
 22106                    b.Property<Guid>("ItemId")
 22107                        .HasColumnType("TEXT");
 22108
 22109                    b.Property<string>("Key")
 22110                        .IsRequired()
 22111                        .HasColumnType("TEXT");
 22112
 22113                    b.Property<Guid>("UserId")
 22114                        .HasColumnType("TEXT");
 22115
 22116                    b.Property<string>("Value")
 22117                        .IsRequired()
 22118                        .HasColumnType("TEXT");
 22119
 22120                    b.HasKey("Id");
 22121
 22122                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 22123                        .IsUnique();
 22124
 22125                    b.ToTable("CustomItemDisplayPreferences");
 22126                });
 127
 22128            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22129                {
 22130                    b.Property<int>("Id")
 22131                        .ValueGeneratedOnAdd()
 22132                        .HasColumnType("INTEGER");
 22133
 22134                    b.Property<int>("ChromecastVersion")
 22135                        .HasColumnType("INTEGER");
 22136
 22137                    b.Property<string>("Client")
 22138                        .IsRequired()
 22139                        .HasMaxLength(32)
 22140                        .HasColumnType("TEXT");
 22141
 22142                    b.Property<string>("DashboardTheme")
 22143                        .HasMaxLength(32)
 22144                        .HasColumnType("TEXT");
 22145
 22146                    b.Property<bool>("EnableNextVideoInfoOverlay")
 22147                        .HasColumnType("INTEGER");
 22148
 22149                    b.Property<int?>("IndexBy")
 22150                        .HasColumnType("INTEGER");
 22151
 22152                    b.Property<Guid>("ItemId")
 22153                        .HasColumnType("TEXT");
 22154
 22155                    b.Property<int>("ScrollDirection")
 22156                        .HasColumnType("INTEGER");
 22157
 22158                    b.Property<bool>("ShowBackdrop")
 22159                        .HasColumnType("INTEGER");
 22160
 22161                    b.Property<bool>("ShowSidebar")
 22162                        .HasColumnType("INTEGER");
 22163
 22164                    b.Property<int>("SkipBackwardLength")
 22165                        .HasColumnType("INTEGER");
 22166
 22167                    b.Property<int>("SkipForwardLength")
 22168                        .HasColumnType("INTEGER");
 22169
 22170                    b.Property<string>("TvHome")
 22171                        .HasMaxLength(32)
 22172                        .HasColumnType("TEXT");
 22173
 22174                    b.Property<Guid>("UserId")
 22175                        .HasColumnType("TEXT");
 22176
 22177                    b.HasKey("Id");
 22178
 22179                    b.HasIndex("UserId", "ItemId", "Client")
 22180                        .IsUnique();
 22181
 22182                    b.ToTable("DisplayPreferences");
 22183                });
 184
 22185            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22186                {
 22187                    b.Property<int>("Id")
 22188                        .ValueGeneratedOnAdd()
 22189                        .HasColumnType("INTEGER");
 22190
 22191                    b.Property<int>("DisplayPreferencesId")
 22192                        .HasColumnType("INTEGER");
 22193
 22194                    b.Property<int>("Order")
 22195                        .HasColumnType("INTEGER");
 22196
 22197                    b.Property<int>("Type")
 22198                        .HasColumnType("INTEGER");
 22199
 22200                    b.HasKey("Id");
 22201
 22202                    b.HasIndex("DisplayPreferencesId");
 22203
 22204                    b.ToTable("HomeSection");
 22205                });
 206
 22207            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22208                {
 22209                    b.Property<int>("Id")
 22210                        .ValueGeneratedOnAdd()
 22211                        .HasColumnType("INTEGER");
 22212
 22213                    b.Property<DateTime>("LastModified")
 22214                        .HasColumnType("TEXT");
 22215
 22216                    b.Property<string>("Path")
 22217                        .IsRequired()
 22218                        .HasMaxLength(512)
 22219                        .HasColumnType("TEXT");
 22220
 22221                    b.Property<Guid?>("UserId")
 22222                        .HasColumnType("TEXT");
 22223
 22224                    b.HasKey("Id");
 22225
 22226                    b.HasIndex("UserId")
 22227                        .IsUnique();
 22228
 22229                    b.ToTable("ImageInfos");
 22230                });
 231
 22232            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22233                {
 22234                    b.Property<int>("Id")
 22235                        .ValueGeneratedOnAdd()
 22236                        .HasColumnType("INTEGER");
 22237
 22238                    b.Property<string>("Client")
 22239                        .IsRequired()
 22240                        .HasMaxLength(32)
 22241                        .HasColumnType("TEXT");
 22242
 22243                    b.Property<int?>("IndexBy")
 22244                        .HasColumnType("INTEGER");
 22245
 22246                    b.Property<Guid>("ItemId")
 22247                        .HasColumnType("TEXT");
 22248
 22249                    b.Property<bool>("RememberIndexing")
 22250                        .HasColumnType("INTEGER");
 22251
 22252                    b.Property<bool>("RememberSorting")
 22253                        .HasColumnType("INTEGER");
 22254
 22255                    b.Property<string>("SortBy")
 22256                        .IsRequired()
 22257                        .HasMaxLength(64)
 22258                        .HasColumnType("TEXT");
 22259
 22260                    b.Property<int>("SortOrder")
 22261                        .HasColumnType("INTEGER");
 22262
 22263                    b.Property<Guid>("UserId")
 22264                        .HasColumnType("TEXT");
 22265
 22266                    b.Property<int>("ViewType")
 22267                        .HasColumnType("INTEGER");
 22268
 22269                    b.HasKey("Id");
 22270
 22271                    b.HasIndex("UserId");
 22272
 22273                    b.ToTable("ItemDisplayPreferences");
 22274                });
 275
 22276            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22277                {
 22278                    b.Property<int>("Id")
 22279                        .ValueGeneratedOnAdd()
 22280                        .HasColumnType("INTEGER");
 22281
 22282                    b.Property<int>("Kind")
 22283                        .HasColumnType("INTEGER");
 22284
 22285                    b.Property<Guid?>("Permission_Permissions_Guid")
 22286                        .HasColumnType("TEXT");
 22287
 22288                    b.Property<uint>("RowVersion")
 22289                        .IsConcurrencyToken()
 22290                        .HasColumnType("INTEGER");
 22291
 22292                    b.Property<Guid?>("UserId")
 22293                        .HasColumnType("TEXT");
 22294
 22295                    b.Property<bool>("Value")
 22296                        .HasColumnType("INTEGER");
 22297
 22298                    b.HasKey("Id");
 22299
 22300                    b.HasIndex("UserId", "Kind")
 22301                        .IsUnique()
 22302                        .HasFilter("[UserId] IS NOT NULL");
 22303
 22304                    b.ToTable("Permissions");
 22305                });
 306
 22307            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22308                {
 22309                    b.Property<int>("Id")
 22310                        .ValueGeneratedOnAdd()
 22311                        .HasColumnType("INTEGER");
 22312
 22313                    b.Property<int>("Kind")
 22314                        .HasColumnType("INTEGER");
 22315
 22316                    b.Property<Guid?>("Preference_Preferences_Guid")
 22317                        .HasColumnType("TEXT");
 22318
 22319                    b.Property<uint>("RowVersion")
 22320                        .IsConcurrencyToken()
 22321                        .HasColumnType("INTEGER");
 22322
 22323                    b.Property<Guid?>("UserId")
 22324                        .HasColumnType("TEXT");
 22325
 22326                    b.Property<string>("Value")
 22327                        .IsRequired()
 22328                        .HasMaxLength(65535)
 22329                        .HasColumnType("TEXT");
 22330
 22331                    b.HasKey("Id");
 22332
 22333                    b.HasIndex("UserId", "Kind")
 22334                        .IsUnique()
 22335                        .HasFilter("[UserId] IS NOT NULL");
 22336
 22337                    b.ToTable("Preferences");
 22338                });
 339
 22340            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 22341                {
 22342                    b.Property<Guid>("Id")
 22343                        .ValueGeneratedOnAdd()
 22344                        .HasColumnType("TEXT");
 22345
 22346                    b.Property<string>("AudioLanguagePreference")
 22347                        .HasMaxLength(255)
 22348                        .HasColumnType("TEXT");
 22349
 22350                    b.Property<string>("AuthenticationProviderId")
 22351                        .IsRequired()
 22352                        .HasMaxLength(255)
 22353                        .HasColumnType("TEXT");
 22354
 22355                    b.Property<bool>("DisplayCollectionsView")
 22356                        .HasColumnType("INTEGER");
 22357
 22358                    b.Property<bool>("DisplayMissingEpisodes")
 22359                        .HasColumnType("INTEGER");
 22360
 22361                    b.Property<string>("EasyPassword")
 22362                        .HasMaxLength(65535)
 22363                        .HasColumnType("TEXT");
 22364
 22365                    b.Property<bool>("EnableAutoLogin")
 22366                        .HasColumnType("INTEGER");
 22367
 22368                    b.Property<bool>("EnableLocalPassword")
 22369                        .HasColumnType("INTEGER");
 22370
 22371                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 22372                        .HasColumnType("INTEGER");
 22373
 22374                    b.Property<bool>("EnableUserPreferenceAccess")
 22375                        .HasColumnType("INTEGER");
 22376
 22377                    b.Property<bool>("HidePlayedInLatest")
 22378                        .HasColumnType("INTEGER");
 22379
 22380                    b.Property<long>("InternalId")
 22381                        .HasColumnType("INTEGER");
 22382
 22383                    b.Property<int>("InvalidLoginAttemptCount")
 22384                        .HasColumnType("INTEGER");
 22385
 22386                    b.Property<DateTime?>("LastActivityDate")
 22387                        .HasColumnType("TEXT");
 22388
 22389                    b.Property<DateTime?>("LastLoginDate")
 22390                        .HasColumnType("TEXT");
 22391
 22392                    b.Property<int?>("LoginAttemptsBeforeLockout")
 22393                        .HasColumnType("INTEGER");
 22394
 22395                    b.Property<int>("MaxActiveSessions")
 22396                        .HasColumnType("INTEGER");
 22397
 22398                    b.Property<int?>("MaxParentalAgeRating")
 22399                        .HasColumnType("INTEGER");
 22400
 22401                    b.Property<bool>("MustUpdatePassword")
 22402                        .HasColumnType("INTEGER");
 22403
 22404                    b.Property<string>("Password")
 22405                        .HasMaxLength(65535)
 22406                        .HasColumnType("TEXT");
 22407
 22408                    b.Property<string>("PasswordResetProviderId")
 22409                        .IsRequired()
 22410                        .HasMaxLength(255)
 22411                        .HasColumnType("TEXT");
 22412
 22413                    b.Property<bool>("PlayDefaultAudioTrack")
 22414                        .HasColumnType("INTEGER");
 22415
 22416                    b.Property<bool>("RememberAudioSelections")
 22417                        .HasColumnType("INTEGER");
 22418
 22419                    b.Property<bool>("RememberSubtitleSelections")
 22420                        .HasColumnType("INTEGER");
 22421
 22422                    b.Property<int?>("RemoteClientBitrateLimit")
 22423                        .HasColumnType("INTEGER");
 22424
 22425                    b.Property<uint>("RowVersion")
 22426                        .IsConcurrencyToken()
 22427                        .HasColumnType("INTEGER");
 22428
 22429                    b.Property<string>("SubtitleLanguagePreference")
 22430                        .HasMaxLength(255)
 22431                        .HasColumnType("TEXT");
 22432
 22433                    b.Property<int>("SubtitleMode")
 22434                        .HasColumnType("INTEGER");
 22435
 22436                    b.Property<int>("SyncPlayAccess")
 22437                        .HasColumnType("INTEGER");
 22438
 22439                    b.Property<string>("Username")
 22440                        .IsRequired()
 22441                        .HasMaxLength(255)
 22442                        .HasColumnType("TEXT")
 22443                        .UseCollation("NOCASE");
 22444
 22445                    b.HasKey("Id");
 22446
 22447                    b.HasIndex("Username")
 22448                        .IsUnique();
 22449
 22450                    b.ToTable("Users");
 22451                });
 452
 22453            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 22454                {
 22455                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22456                        .WithMany("AccessSchedules")
 22457                        .HasForeignKey("UserId")
 22458                        .OnDelete(DeleteBehavior.Cascade)
 22459                        .IsRequired();
 22460                });
 461
 22462            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22463                {
 22464                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22465                        .WithMany("DisplayPreferences")
 22466                        .HasForeignKey("UserId")
 22467                        .OnDelete(DeleteBehavior.Cascade)
 22468                        .IsRequired();
 22469                });
 470
 22471            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22472                {
 22473                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 22474                        .WithMany("HomeSections")
 22475                        .HasForeignKey("DisplayPreferencesId")
 22476                        .OnDelete(DeleteBehavior.Cascade)
 22477                        .IsRequired();
 22478                });
 479
 22480            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22481                {
 22482                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22483                        .WithOne("ProfileImage")
 22484                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId")
 22485                        .OnDelete(DeleteBehavior.Cascade);
 22486                });
 487
 22488            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22489                {
 22490                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22491                        .WithMany("ItemDisplayPreferences")
 22492                        .HasForeignKey("UserId")
 22493                        .OnDelete(DeleteBehavior.Cascade)
 22494                        .IsRequired();
 22495                });
 496
 22497            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22498                {
 22499                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22500                        .WithMany("Permissions")
 22501                        .HasForeignKey("UserId")
 22502                        .OnDelete(DeleteBehavior.Cascade);
 22503                });
 504
 22505            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22506                {
 22507                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22508                        .WithMany("Preferences")
 22509                        .HasForeignKey("UserId")
 22510                        .OnDelete(DeleteBehavior.Cascade);
 22511                });
 512
 22513            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22514                {
 22515                    b.Navigation("HomeSections");
 22516                });
 517
 22518            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 22519                {
 22520                    b.Navigation("AccessSchedules");
 22521
 22522                    b.Navigation("DisplayPreferences");
 22523
 22524                    b.Navigation("ItemDisplayPreferences");
 22525
 22526                    b.Navigation("Permissions");
 22527
 22528                    b.Navigation("Preferences");
 22529
 22530                    b.Navigation("ProfileImage");
 22531                });
 532#pragma warning restore 612, 618
 22533        }
 534    }
 535}