20210712022424_7-12-2.cs 1.7 KB

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