20240226083813_userHistory.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace MTWorkHR.Infrastructure.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class userHistory : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AddColumn<long>(
  12. name: "UserTaskId",
  13. table: "UserTaskHistories",
  14. type: "bigint",
  15. nullable: true);
  16. migrationBuilder.CreateIndex(
  17. name: "IX_UserTaskHistories_UserTaskId",
  18. table: "UserTaskHistories",
  19. column: "UserTaskId");
  20. migrationBuilder.AddForeignKey(
  21. name: "FK_UserTaskHistories_UserTasks_UserTaskId",
  22. table: "UserTaskHistories",
  23. column: "UserTaskId",
  24. principalTable: "UserTasks",
  25. principalColumn: "Id");
  26. }
  27. /// <inheritdoc />
  28. protected override void Down(MigrationBuilder migrationBuilder)
  29. {
  30. migrationBuilder.DropForeignKey(
  31. name: "FK_UserTaskHistories_UserTasks_UserTaskId",
  32. table: "UserTaskHistories");
  33. migrationBuilder.DropIndex(
  34. name: "IX_UserTaskHistories_UserTaskId",
  35. table: "UserTaskHistories");
  36. migrationBuilder.DropColumn(
  37. name: "UserTaskId",
  38. table: "UserTaskHistories");
  39. }
  40. }
  41. }