20241113133548_EnforceUniqueItemValue.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Jellyfin.Server.Implementations.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class EnforceUniqueItemValue : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.DropIndex(
  12. name: "IX_ItemValues_Type_CleanValue",
  13. table: "ItemValues");
  14. migrationBuilder.CreateIndex(
  15. name: "IX_ItemValues_Type_CleanValue",
  16. table: "ItemValues",
  17. columns: new[] { "Type", "CleanValue" },
  18. unique: true);
  19. }
  20. /// <inheritdoc />
  21. protected override void Down(MigrationBuilder migrationBuilder)
  22. {
  23. migrationBuilder.DropIndex(
  24. name: "IX_ItemValues_Type_CleanValue",
  25. table: "ItemValues");
  26. migrationBuilder.CreateIndex(
  27. name: "IX_ItemValues_Type_CleanValue",
  28. table: "ItemValues",
  29. columns: new[] { "Type", "CleanValue" });
  30. }
  31. }
  32. }