20210712020837_7-12-1.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace WCS.Service.Migrations
  4. {
  5. public partial class _7121 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "WCS_ROUTE",
  11. columns: table => new
  12. {
  13. ID = table.Column<int>(type: "int", nullable: false)
  14. .Annotation("SqlServer:Identity", "1, 1"),
  15. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  16. NEXTDEVICE = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
  17. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  18. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  19. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  20. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  21. },
  22. constraints: table =>
  23. {
  24. table.PrimaryKey("PK_WCS_ROUTE", x => x.ID);
  25. table.ForeignKey(
  26. name: "FK_WCS_ROUTE_WCS_DEVICE_DEVICECODE",
  27. column: x => x.DEVICECODE,
  28. principalTable: "WCS_DEVICE",
  29. principalColumn: "CODE",
  30. onDelete: ReferentialAction.Cascade);
  31. });
  32. migrationBuilder.CreateIndex(
  33. name: "IX_WCS_ROUTE_DEVICECODE",
  34. table: "WCS_ROUTE",
  35. column: "DEVICECODE");
  36. }
  37. protected override void Down(MigrationBuilder migrationBuilder)
  38. {
  39. migrationBuilder.DropTable(
  40. name: "WCS_ROUTE");
  41. }
  42. }
  43. }