diff options
| author | crobibero <cody@robibe.ro> | 2020-12-04 16:00:11 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-12-04 16:00:11 -0700 |
| commit | 3db6ae91f6aa68a1eaf3da3d385b069bdd7721ee (patch) | |
| tree | 7e4092397fdfb1f5c6e33ca5ea464cddb7c90996 /Jellyfin.Server.Implementations/Migrations | |
| parent | 8d8738835ecc36c6f00157d4131d8200d5dd582a (diff) | |
Add ItemId to all display preferences
Diffstat (limited to 'Jellyfin.Server.Implementations/Migrations')
| -rw-r--r-- | Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs (renamed from Jellyfin.Server.Implementations/Migrations/20201203203707_AddCustomDisplayPreferences.Designer.cs) | 12 | ||||
| -rw-r--r-- | Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.cs (renamed from Jellyfin.Server.Implementations/Migrations/20201203203707_AddCustomDisplayPreferences.cs) | 42 | ||||
| -rw-r--r-- | Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs | 10 |
3 files changed, 57 insertions, 7 deletions
diff --git a/Jellyfin.Server.Implementations/Migrations/20201203203707_AddCustomDisplayPreferences.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs index ce3e30b599..10663d0655 100644 --- a/Jellyfin.Server.Implementations/Migrations/20201203203707_AddCustomDisplayPreferences.Designer.cs +++ b/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs @@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Jellyfin.Server.Implementations.Migrations { [DbContext(typeof(JellyfinDb))] - [Migration("20201203203707_AddCustomDisplayPreferences")] + [Migration("20201204223655_AddCustomDisplayPreferences")] partial class AddCustomDisplayPreferences { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -102,6 +102,9 @@ namespace Jellyfin.Server.Implementations.Migrations .HasMaxLength(32) .HasColumnType("TEXT"); + b.Property<Guid>("ItemId") + .HasColumnType("TEXT"); + b.Property<string>("Key") .IsRequired() .HasColumnType("TEXT"); @@ -117,7 +120,7 @@ namespace Jellyfin.Server.Implementations.Migrations b.HasIndex("UserId"); - b.HasIndex("UserId", "Client", "Key") + b.HasIndex("UserId", "ItemId", "Client", "Key") .IsUnique(); b.ToTable("CustomItemDisplayPreferences"); @@ -147,6 +150,9 @@ namespace Jellyfin.Server.Implementations.Migrations b.Property<int?>("IndexBy") .HasColumnType("INTEGER"); + b.Property<Guid>("ItemId") + .HasColumnType("TEXT"); + b.Property<int>("ScrollDirection") .HasColumnType("INTEGER"); @@ -173,7 +179,7 @@ namespace Jellyfin.Server.Implementations.Migrations b.HasIndex("UserId"); - b.HasIndex("UserId", "Client") + b.HasIndex("UserId", "ItemId", "Client") .IsUnique(); b.ToTable("DisplayPreferences"); diff --git a/Jellyfin.Server.Implementations/Migrations/20201203203707_AddCustomDisplayPreferences.cs b/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.cs index a07b265928..fbc0bffa97 100644 --- a/Jellyfin.Server.Implementations/Migrations/20201203203707_AddCustomDisplayPreferences.cs +++ b/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.cs @@ -9,6 +9,11 @@ namespace Jellyfin.Server.Implementations.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.DropIndex( + name: "IX_DisplayPreferences_UserId_Client", + schema: "jellyfin", + table: "DisplayPreferences"); + migrationBuilder.AlterColumn<int>( name: "MaxActiveSessions", schema: "jellyfin", @@ -20,6 +25,14 @@ namespace Jellyfin.Server.Implementations.Migrations oldType: "INTEGER", oldNullable: true); + migrationBuilder.AddColumn<Guid>( + name: "ItemId", + schema: "jellyfin", + table: "DisplayPreferences", + type: "TEXT", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + migrationBuilder.CreateTable( name: "CustomItemDisplayPreferences", schema: "jellyfin", @@ -28,6 +41,7 @@ namespace Jellyfin.Server.Implementations.Migrations Id = table.Column<int>(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), UserId = table.Column<Guid>(type: "TEXT", nullable: false), + ItemId = table.Column<Guid>(type: "TEXT", nullable: false), Client = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false), Key = table.Column<string>(type: "TEXT", nullable: false), Value = table.Column<string>(type: "TEXT", nullable: false) @@ -38,16 +52,23 @@ namespace Jellyfin.Server.Implementations.Migrations }); migrationBuilder.CreateIndex( + name: "IX_DisplayPreferences_UserId_ItemId_Client", + schema: "jellyfin", + table: "DisplayPreferences", + columns: new[] { "UserId", "ItemId", "Client" }, + unique: true); + + migrationBuilder.CreateIndex( name: "IX_CustomItemDisplayPreferences_UserId", schema: "jellyfin", table: "CustomItemDisplayPreferences", column: "UserId"); migrationBuilder.CreateIndex( - name: "IX_CustomItemDisplayPreferences_UserId_Client_Key", + name: "IX_CustomItemDisplayPreferences_UserId_ItemId_Client_Key", schema: "jellyfin", table: "CustomItemDisplayPreferences", - columns: new[] { "UserId", "Client", "Key" }, + columns: new[] { "UserId", "ItemId", "Client", "Key" }, unique: true); } @@ -57,6 +78,16 @@ namespace Jellyfin.Server.Implementations.Migrations name: "CustomItemDisplayPreferences", schema: "jellyfin"); + migrationBuilder.DropIndex( + name: "IX_DisplayPreferences_UserId_ItemId_Client", + schema: "jellyfin", + table: "DisplayPreferences"); + + migrationBuilder.DropColumn( + name: "ItemId", + schema: "jellyfin", + table: "DisplayPreferences"); + migrationBuilder.AlterColumn<int>( name: "MaxActiveSessions", schema: "jellyfin", @@ -65,6 +96,13 @@ namespace Jellyfin.Server.Implementations.Migrations nullable: true, oldClrType: typeof(int), oldType: "INTEGER"); + + migrationBuilder.CreateIndex( + name: "IX_DisplayPreferences_UserId_Client", + schema: "jellyfin", + table: "DisplayPreferences", + columns: new[] { "UserId", "Client" }, + unique: true); } } } diff --git a/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs b/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs index 3b85c911cd..1614a88efb 100644 --- a/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs +++ b/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs @@ -99,6 +99,9 @@ namespace Jellyfin.Server.Implementations.Migrations .HasMaxLength(32) .HasColumnType("TEXT"); + b.Property<Guid>("ItemId") + .HasColumnType("TEXT"); + b.Property<string>("Key") .IsRequired() .HasColumnType("TEXT"); @@ -114,7 +117,7 @@ namespace Jellyfin.Server.Implementations.Migrations b.HasIndex("UserId"); - b.HasIndex("UserId", "Client", "Key") + b.HasIndex("UserId", "ItemId", "Client", "Key") .IsUnique(); b.ToTable("CustomItemDisplayPreferences"); @@ -144,6 +147,9 @@ namespace Jellyfin.Server.Implementations.Migrations b.Property<int?>("IndexBy") .HasColumnType("INTEGER"); + b.Property<Guid>("ItemId") + .HasColumnType("TEXT"); + b.Property<int>("ScrollDirection") .HasColumnType("INTEGER"); @@ -170,7 +176,7 @@ namespace Jellyfin.Server.Implementations.Migrations b.HasIndex("UserId"); - b.HasIndex("UserId", "Client") + b.HasIndex("UserId", "ItemId", "Client") .IsUnique(); b.ToTable("DisplayPreferences"); |
