20241111135439_AddedCustomDataKeyKey.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Jellyfin.Server.Implementations.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class AddedCustomDataKeyKey : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.DropPrimaryKey(
  12. name: "PK_UserData",
  13. table: "UserData");
  14. migrationBuilder.AlterColumn<string>(
  15. name: "CustomDataKey",
  16. table: "UserData",
  17. type: "TEXT",
  18. nullable: false,
  19. defaultValue: string.Empty,
  20. oldClrType: typeof(string),
  21. oldType: "TEXT",
  22. oldNullable: true);
  23. migrationBuilder.AddPrimaryKey(
  24. name: "PK_UserData",
  25. table: "UserData",
  26. columns: new[] { "ItemId", "UserId", "CustomDataKey" });
  27. }
  28. /// <inheritdoc />
  29. protected override void Down(MigrationBuilder migrationBuilder)
  30. {
  31. migrationBuilder.DropPrimaryKey(
  32. name: "PK_UserData",
  33. table: "UserData");
  34. migrationBuilder.AlterColumn<string>(
  35. name: "CustomDataKey",
  36. table: "UserData",
  37. type: "TEXT",
  38. nullable: true,
  39. oldClrType: typeof(string),
  40. oldType: "TEXT");
  41. migrationBuilder.AddPrimaryKey(
  42. name: "PK_UserData",
  43. table: "UserData",
  44. columns: new[] { "ItemId", "UserId" });
  45. }
  46. }
  47. }