20220304034645_2022030411.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. namespace WCS.Service.Migrations
  3. {
  4. public partial class _2022030411 : Migration
  5. {
  6. protected override void Up(MigrationBuilder migrationBuilder)
  7. {
  8. migrationBuilder.DropForeignKey(
  9. name: "FK_WCS_StatusLog_WCS_TASK_WCS_TASKID",
  10. table: "WCS_StatusLog");
  11. migrationBuilder.DropIndex(
  12. name: "IX_WCS_StatusLog_WCS_TASKID",
  13. table: "WCS_StatusLog");
  14. migrationBuilder.AlterColumn<int>(
  15. name: "WCS_TASKID",
  16. table: "WCS_StatusLog",
  17. type: "int",
  18. nullable: false,
  19. defaultValue: 0,
  20. oldClrType: typeof(int),
  21. oldType: "int",
  22. oldNullable: true);
  23. }
  24. protected override void Down(MigrationBuilder migrationBuilder)
  25. {
  26. migrationBuilder.AlterColumn<int>(
  27. name: "WCS_TASKID",
  28. table: "WCS_StatusLog",
  29. type: "int",
  30. nullable: true,
  31. oldClrType: typeof(int),
  32. oldType: "int");
  33. migrationBuilder.CreateIndex(
  34. name: "IX_WCS_StatusLog_WCS_TASKID",
  35. table: "WCS_StatusLog",
  36. column: "WCS_TASKID");
  37. migrationBuilder.AddForeignKey(
  38. name: "FK_WCS_StatusLog_WCS_TASK_WCS_TASKID",
  39. table: "WCS_StatusLog",
  40. column: "WCS_TASKID",
  41. principalTable: "WCS_TASK",
  42. principalColumn: "ID",
  43. onDelete: ReferentialAction.Restrict);
  44. }
  45. }
  46. }