20240801152322_altrTaskHistory3.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace MTWorkHR.Infrastructure.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class altrTaskHistory3 : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AlterColumn<string>(
  12. name: "AssignedToUserId",
  13. table: "UserTaskHistories",
  14. type: "nvarchar(max)",
  15. nullable: true,
  16. oldClrType: typeof(long),
  17. oldType: "bigint");
  18. migrationBuilder.AddColumn<byte[]>(
  19. name: "Content",
  20. table: "UserTaskAttachments",
  21. type: "varbinary(max)",
  22. nullable: false,
  23. defaultValue: new byte[0]);
  24. migrationBuilder.AddColumn<string>(
  25. name: "ContentType",
  26. table: "UserTaskAttachments",
  27. type: "nvarchar(max)",
  28. nullable: true);
  29. migrationBuilder.AddColumn<string>(
  30. name: "FilePath",
  31. table: "UserTaskAttachments",
  32. type: "nvarchar(max)",
  33. nullable: true);
  34. }
  35. /// <inheritdoc />
  36. protected override void Down(MigrationBuilder migrationBuilder)
  37. {
  38. migrationBuilder.DropColumn(
  39. name: "Content",
  40. table: "UserTaskAttachments");
  41. migrationBuilder.DropColumn(
  42. name: "ContentType",
  43. table: "UserTaskAttachments");
  44. migrationBuilder.DropColumn(
  45. name: "FilePath",
  46. table: "UserTaskAttachments");
  47. migrationBuilder.AlterColumn<long>(
  48. name: "AssignedToUserId",
  49. table: "UserTaskHistories",
  50. type: "bigint",
  51. nullable: false,
  52. defaultValue: 0L,
  53. oldClrType: typeof(string),
  54. oldType: "nvarchar(max)",
  55. oldNullable: true);
  56. }
  57. }
  58. }