aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs')
-rw-r--r--Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs b/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs
new file mode 100644
index 000000000..d1b06ceae
--- /dev/null
+++ b/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs
@@ -0,0 +1,37 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Jellyfin.Server.Implementations.Migrations
+{
+ /// <inheritdoc />
+ public partial class EnforceUniqueItemValue : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropIndex(
+ name: "IX_ItemValues_Type_CleanValue",
+ table: "ItemValues");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ItemValues_Type_CleanValue",
+ table: "ItemValues",
+ columns: new[] { "Type", "CleanValue" },
+ unique: true);
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropIndex(
+ name: "IX_ItemValues_Type_CleanValue",
+ table: "ItemValues");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ItemValues_Type_CleanValue",
+ table: "ItemValues",
+ columns: new[] { "Type", "CleanValue" });
+ }
+ }
+}