ソースを参照

Add the user data to the schema

Patrick Barron 5 年 前
コミット
a78184ef44

+ 2 - 0
Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj

@@ -23,6 +23,8 @@
     <Compile Include="..\SharedVersion.cs" />
     <Compile Remove="Migrations\20200430214405_InitialSchema.cs" />
     <Compile Remove="Migrations\20200430214405_InitialSchema.Designer.cs" />
+    <Compile Remove="Migrations\20200504195424_UserSchema.cs" />
+    <Compile Remove="Migrations\20200504195424_UserSchema.Designer.cs" />
   </ItemGroup>
 
   <ItemGroup>

+ 6 - 6
Jellyfin.Server.Implementations/JellyfinDb.cs

@@ -16,6 +16,11 @@ namespace Jellyfin.Server.Implementations
     public partial class JellyfinDb : DbContext
     {
         public virtual DbSet<ActivityLog> ActivityLogs { get; set; }
+        public virtual DbSet<Group> Groups { get; set; }
+        public virtual DbSet<Permission> Permissions { get; set; }
+        public virtual DbSet<Preference> Preferences { get; set; }
+        public virtual DbSet<ProviderMapping> ProviderMappings { get; set; }
+        public virtual DbSet<User> Users { get; set; }
         /*public virtual DbSet<Artwork> Artwork { get; set; }
         public virtual DbSet<Book> Books { get; set; }
         public virtual DbSet<BookMetadata> BookMetadata { get; set; }
@@ -29,7 +34,6 @@ namespace Jellyfin.Server.Implementations
         public virtual DbSet<Episode> Episodes { get; set; }
         public virtual DbSet<EpisodeMetadata> EpisodeMetadata { get; set; }
         public virtual DbSet<Genre> Genres { get; set; }
-        public virtual DbSet<Group> Groups { get; set; }
         public virtual DbSet<Library> Libraries { get; set; }
         public virtual DbSet<LibraryItem> LibraryItems { get; set; }
         public virtual DbSet<LibraryRoot> LibraryRoot { get; set; }
@@ -42,13 +46,10 @@ namespace Jellyfin.Server.Implementations
         public virtual DbSet<MovieMetadata> MovieMetadata { get; set; }
         public virtual DbSet<MusicAlbum> MusicAlbums { get; set; }
         public virtual DbSet<MusicAlbumMetadata> MusicAlbumMetadata { get; set; }
-        public virtual DbSet<Permission> Permissions { get; set; }
         public virtual DbSet<Person> People { get; set; }
         public virtual DbSet<PersonRole> PersonRoles { get; set; }
         public virtual DbSet<Photo> Photo { get; set; }
         public virtual DbSet<PhotoMetadata> PhotoMetadata { get; set; }
-        public virtual DbSet<Preference> Preferences { get; set; }
-        public virtual DbSet<ProviderMapping> ProviderMappings { get; set; }
         public virtual DbSet<Rating> Ratings { get; set; }
 
         /// <summary>
@@ -62,8 +63,7 @@ namespace Jellyfin.Server.Implementations
         public virtual DbSet<Series> Series { get; set; }
         public virtual DbSet<SeriesMetadata> SeriesMetadata { get; set; }
         public virtual DbSet<Track> Tracks { get; set; }
-        public virtual DbSet<TrackMetadata> TrackMetadata { get; set; }
-        public virtual DbSet<User> Users { get; set; } */
+        public virtual DbSet<TrackMetadata> TrackMetadata { get; set; } */
 
         /// <summary>
         /// Gets or sets the default connection string.

+ 324 - 0
Jellyfin.Server.Implementations/Migrations/20200504195702_UserSchema.Designer.cs

@@ -0,0 +1,324 @@
+#pragma warning disable CS1591
+#pragma warning disable SA1601
+
+// <auto-generated />
+using System;
+using Jellyfin.Server.Implementations;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+namespace Jellyfin.Server.Implementations.Migrations
+{
+    [DbContext(typeof(JellyfinDb))]
+    [Migration("20200504195702_UserSchema")]
+    partial class UserSchema
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasDefaultSchema("jellyfin")
+                .HasAnnotation("ProductVersion", "3.1.3");
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<DateTime>("DateCreated")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ItemId")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(256);
+
+                    b.Property<int>("LogSeverity")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(512);
+
+                    b.Property<string>("Overview")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(512);
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("ShortOverview")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(512);
+
+                    b.Property<string>("Type")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(256);
+
+                    b.Property<Guid>("UserId")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("ActivityLog");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Group", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Group_Groups_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Group_Groups_Id");
+
+                    b.ToTable("Group");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int>("Kind")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Permission_GroupPermissions_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Permission_Permissions_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("Value")
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Permission_GroupPermissions_Id");
+
+                    b.HasIndex("Permission_Permissions_Id");
+
+                    b.ToTable("Permission");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int>("Kind")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Preference_Preferences_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Value")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Preference_Preferences_Id");
+
+                    b.ToTable("Preference");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.ProviderMapping", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("ProviderData")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<int?>("ProviderMapping_ProviderMappings_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("ProviderName")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("ProviderSecrets")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ProviderMapping_ProviderMappings_Id");
+
+                    b.ToTable("ProviderMapping");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("AudioLanguagePreference")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("AuthenticationProviderId")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<bool?>("DisplayCollectionsView")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("DisplayMissingEpisodes")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("EnableNextEpisodeAutoPlay")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("EnableUserPreferenceAccess")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("GroupedFolders")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<bool?>("HidePlayedInLatest")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int>("InvalidLoginAttemptCount")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("LatestItemExcludes")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<int?>("LoginAttemptsBeforeLockout")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("MustUpdatePassword")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("MyMediaExcludes")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<string>("OrderedViews")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<string>("Password")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<bool>("PlayDefaultAudioTrack")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("RememberAudioSelections")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("RememberSubtitleSelections")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("SubtitleLanguagePrefernce")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("SubtitleMode")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("Username")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.HasKey("Id");
+
+                    b.ToTable("User");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Group", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("Groups")
+                        .HasForeignKey("Group_Groups_Id");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.Group", null)
+                        .WithMany("GroupPermissions")
+                        .HasForeignKey("Permission_GroupPermissions_Id");
+
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("Permissions")
+                        .HasForeignKey("Permission_Permissions_Id");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.Group", null)
+                        .WithMany("Preferences")
+                        .HasForeignKey("Preference_Preferences_Id");
+
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("Preferences")
+                        .HasForeignKey("Preference_Preferences_Id");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.ProviderMapping", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.Group", null)
+                        .WithMany("ProviderMappings")
+                        .HasForeignKey("ProviderMapping_ProviderMappings_Id");
+
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("ProviderMappings")
+                        .HasForeignKey("ProviderMapping_ProviderMappings_Id");
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}

+ 219 - 0
Jellyfin.Server.Implementations/Migrations/20200504195702_UserSchema.cs

@@ -0,0 +1,219 @@
+#pragma warning disable CS1591
+#pragma warning disable SA1601
+
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Jellyfin.Server.Implementations.Migrations
+{
+    public partial class UserSchema : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "User",
+                schema: "jellyfin",
+                columns: table => new
+                {
+                    Id = table.Column<int>(nullable: false)
+                        .Annotation("Sqlite:Autoincrement", true),
+                    Username = table.Column<string>(maxLength: 255, nullable: false),
+                    Password = table.Column<string>(maxLength: 65535, nullable: true),
+                    MustUpdatePassword = table.Column<bool>(nullable: false),
+                    AudioLanguagePreference = table.Column<string>(maxLength: 255, nullable: false),
+                    AuthenticationProviderId = table.Column<string>(maxLength: 255, nullable: false),
+                    GroupedFolders = table.Column<string>(maxLength: 65535, nullable: true),
+                    InvalidLoginAttemptCount = table.Column<int>(nullable: false),
+                    LatestItemExcludes = table.Column<string>(maxLength: 65535, nullable: true),
+                    LoginAttemptsBeforeLockout = table.Column<int>(nullable: true),
+                    MyMediaExcludes = table.Column<string>(maxLength: 65535, nullable: true),
+                    OrderedViews = table.Column<string>(maxLength: 65535, nullable: true),
+                    SubtitleMode = table.Column<string>(maxLength: 255, nullable: false),
+                    PlayDefaultAudioTrack = table.Column<bool>(nullable: false),
+                    SubtitleLanguagePrefernce = table.Column<string>(maxLength: 255, nullable: true),
+                    DisplayMissingEpisodes = table.Column<bool>(nullable: true),
+                    DisplayCollectionsView = table.Column<bool>(nullable: true),
+                    HidePlayedInLatest = table.Column<bool>(nullable: true),
+                    RememberAudioSelections = table.Column<bool>(nullable: true),
+                    RememberSubtitleSelections = table.Column<bool>(nullable: true),
+                    EnableNextEpisodeAutoPlay = table.Column<bool>(nullable: true),
+                    EnableUserPreferenceAccess = table.Column<bool>(nullable: true),
+                    RowVersion = table.Column<uint>(nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_User", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Group",
+                schema: "jellyfin",
+                columns: table => new
+                {
+                    Id = table.Column<int>(nullable: false)
+                        .Annotation("Sqlite:Autoincrement", true),
+                    Name = table.Column<string>(maxLength: 255, nullable: false),
+                    RowVersion = table.Column<uint>(nullable: false),
+                    Group_Groups_Id = table.Column<int>(nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Group", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Group_User_Group_Groups_Id",
+                        column: x => x.Group_Groups_Id,
+                        principalSchema: "jellyfin",
+                        principalTable: "User",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Permission",
+                schema: "jellyfin",
+                columns: table => new
+                {
+                    Id = table.Column<int>(nullable: false)
+                        .Annotation("Sqlite:Autoincrement", true),
+                    Kind = table.Column<int>(nullable: false),
+                    Value = table.Column<bool>(nullable: false),
+                    RowVersion = table.Column<uint>(nullable: false),
+                    Permission_GroupPermissions_Id = table.Column<int>(nullable: true),
+                    Permission_Permissions_Id = table.Column<int>(nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Permission", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Permission_Group_Permission_GroupPermissions_Id",
+                        column: x => x.Permission_GroupPermissions_Id,
+                        principalSchema: "jellyfin",
+                        principalTable: "Group",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_Permission_User_Permission_Permissions_Id",
+                        column: x => x.Permission_Permissions_Id,
+                        principalSchema: "jellyfin",
+                        principalTable: "User",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Preference",
+                schema: "jellyfin",
+                columns: table => new
+                {
+                    Id = table.Column<int>(nullable: false)
+                        .Annotation("Sqlite:Autoincrement", true),
+                    Kind = table.Column<int>(nullable: false),
+                    Value = table.Column<string>(maxLength: 65535, nullable: false),
+                    RowVersion = table.Column<uint>(nullable: false),
+                    Preference_Preferences_Id = table.Column<int>(nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Preference", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Preference_Group_Preference_Preferences_Id",
+                        column: x => x.Preference_Preferences_Id,
+                        principalSchema: "jellyfin",
+                        principalTable: "Group",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_Preference_User_Preference_Preferences_Id",
+                        column: x => x.Preference_Preferences_Id,
+                        principalSchema: "jellyfin",
+                        principalTable: "User",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ProviderMapping",
+                schema: "jellyfin",
+                columns: table => new
+                {
+                    Id = table.Column<int>(nullable: false)
+                        .Annotation("Sqlite:Autoincrement", true),
+                    ProviderName = table.Column<string>(maxLength: 255, nullable: false),
+                    ProviderSecrets = table.Column<string>(maxLength: 65535, nullable: false),
+                    ProviderData = table.Column<string>(maxLength: 65535, nullable: false),
+                    RowVersion = table.Column<uint>(nullable: false),
+                    ProviderMapping_ProviderMappings_Id = table.Column<int>(nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ProviderMapping", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_ProviderMapping_Group_ProviderMapping_ProviderMappings_Id",
+                        column: x => x.ProviderMapping_ProviderMappings_Id,
+                        principalSchema: "jellyfin",
+                        principalTable: "Group",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_ProviderMapping_User_ProviderMapping_ProviderMappings_Id",
+                        column: x => x.ProviderMapping_ProviderMappings_Id,
+                        principalSchema: "jellyfin",
+                        principalTable: "User",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Group_Group_Groups_Id",
+                schema: "jellyfin",
+                table: "Group",
+                column: "Group_Groups_Id");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Permission_Permission_GroupPermissions_Id",
+                schema: "jellyfin",
+                table: "Permission",
+                column: "Permission_GroupPermissions_Id");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Permission_Permission_Permissions_Id",
+                schema: "jellyfin",
+                table: "Permission",
+                column: "Permission_Permissions_Id");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Preference_Preference_Preferences_Id",
+                schema: "jellyfin",
+                table: "Preference",
+                column: "Preference_Preferences_Id");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ProviderMapping_ProviderMapping_ProviderMappings_Id",
+                schema: "jellyfin",
+                table: "ProviderMapping",
+                column: "ProviderMapping_ProviderMappings_Id");
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "Permission",
+                schema: "jellyfin");
+
+            migrationBuilder.DropTable(
+                name: "Preference",
+                schema: "jellyfin");
+
+            migrationBuilder.DropTable(
+                name: "ProviderMapping",
+                schema: "jellyfin");
+
+            migrationBuilder.DropTable(
+                name: "Group",
+                schema: "jellyfin");
+
+            migrationBuilder.DropTable(
+                name: "User",
+                schema: "jellyfin");
+        }
+    }
+}

+ 251 - 0
Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs

@@ -62,6 +62,257 @@ namespace Jellyfin.Server.Implementations.Migrations
 
                     b.ToTable("ActivityLog");
                 });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Group", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Group_Groups_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Group_Groups_Id");
+
+                    b.ToTable("Group");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int>("Kind")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Permission_GroupPermissions_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Permission_Permissions_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("Value")
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Permission_GroupPermissions_Id");
+
+                    b.HasIndex("Permission_Permissions_Id");
+
+                    b.ToTable("Permission");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int>("Kind")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int?>("Preference_Preferences_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Value")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Preference_Preferences_Id");
+
+                    b.ToTable("Preference");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.ProviderMapping", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("ProviderData")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<int?>("ProviderMapping_ProviderMappings_Id")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("ProviderName")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("ProviderSecrets")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ProviderMapping_ProviderMappings_Id");
+
+                    b.ToTable("ProviderMapping");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("AudioLanguagePreference")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("AuthenticationProviderId")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<bool?>("DisplayCollectionsView")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("DisplayMissingEpisodes")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("EnableNextEpisodeAutoPlay")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("EnableUserPreferenceAccess")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("GroupedFolders")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<bool?>("HidePlayedInLatest")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<int>("InvalidLoginAttemptCount")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("LatestItemExcludes")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<int?>("LoginAttemptsBeforeLockout")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("MustUpdatePassword")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("MyMediaExcludes")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<string>("OrderedViews")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<string>("Password")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(65535);
+
+                    b.Property<bool>("PlayDefaultAudioTrack")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("RememberAudioSelections")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool?>("RememberSubtitleSelections")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<uint>("RowVersion")
+                        .IsConcurrencyToken()
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("SubtitleLanguagePrefernce")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("SubtitleMode")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.Property<string>("Username")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(255);
+
+                    b.HasKey("Id");
+
+                    b.ToTable("User");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Group", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("Groups")
+                        .HasForeignKey("Group_Groups_Id");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.Group", null)
+                        .WithMany("GroupPermissions")
+                        .HasForeignKey("Permission_GroupPermissions_Id");
+
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("Permissions")
+                        .HasForeignKey("Permission_Permissions_Id");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.Group", null)
+                        .WithMany("Preferences")
+                        .HasForeignKey("Preference_Preferences_Id");
+
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("Preferences")
+                        .HasForeignKey("Preference_Preferences_Id");
+                });
+
+            modelBuilder.Entity("Jellyfin.Data.Entities.ProviderMapping", b =>
+                {
+                    b.HasOne("Jellyfin.Data.Entities.Group", null)
+                        .WithMany("ProviderMappings")
+                        .HasForeignKey("ProviderMapping_ProviderMappings_Id");
+
+                    b.HasOne("Jellyfin.Data.Entities.User", null)
+                        .WithMany("ProviderMappings")
+                        .HasForeignKey("ProviderMapping_ProviderMappings_Id");
+                });
 #pragma warning restore 612, 618
         }
     }