20210712055535_7-12-4.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. namespace WCS.Service.Migrations
  3. {
  4. public partial class _7124 : Migration
  5. {
  6. protected override void Up(MigrationBuilder migrationBuilder)
  7. {
  8. migrationBuilder.DropForeignKey(
  9. name: "FK_WCS_PATH_WCS_DEVICE_STARTCODE",
  10. table: "WCS_PATH");
  11. migrationBuilder.AlterColumn<string>(
  12. name: "STARTCODE",
  13. table: "WCS_PATH",
  14. type: "nvarchar(50)",
  15. nullable: false,
  16. defaultValue: "",
  17. oldClrType: typeof(string),
  18. oldType: "nvarchar(50)",
  19. oldNullable: true);
  20. migrationBuilder.AddForeignKey(
  21. name: "FK_WCS_PATH_WCS_DEVICE_STARTCODE",
  22. table: "WCS_PATH",
  23. column: "STARTCODE",
  24. principalTable: "WCS_DEVICE",
  25. principalColumn: "CODE",
  26. onDelete: ReferentialAction.Cascade);
  27. }
  28. protected override void Down(MigrationBuilder migrationBuilder)
  29. {
  30. migrationBuilder.DropForeignKey(
  31. name: "FK_WCS_PATH_WCS_DEVICE_STARTCODE",
  32. table: "WCS_PATH");
  33. migrationBuilder.AlterColumn<string>(
  34. name: "STARTCODE",
  35. table: "WCS_PATH",
  36. type: "nvarchar(50)",
  37. nullable: true,
  38. oldClrType: typeof(string),
  39. oldType: "nvarchar(50)");
  40. migrationBuilder.AddForeignKey(
  41. name: "FK_WCS_PATH_WCS_DEVICE_STARTCODE",
  42. table: "WCS_PATH",
  43. column: "STARTCODE",
  44. principalTable: "WCS_DEVICE",
  45. principalColumn: "CODE",
  46. onDelete: ReferentialAction.Restrict);
  47. }
  48. }
  49. }