20210712055357_7-12-3.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace WCS.Service.Migrations
  4. {
  5. public partial class _7123 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "WCS_PATH",
  11. columns: table => new
  12. {
  13. ID = table.Column<int>(type: "int", nullable: false)
  14. .Annotation("SqlServer:Identity", "1, 1"),
  15. STARTCODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  16. ENDCODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  17. PATH = table.Column<string>(type: "nvarchar(max)", nullable: false),
  18. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  19. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  20. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  21. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  22. },
  23. constraints: table =>
  24. {
  25. table.PrimaryKey("PK_WCS_PATH", x => x.ID);
  26. table.ForeignKey(
  27. name: "FK_WCS_PATH_WCS_DEVICE_ENDCODE",
  28. column: x => x.ENDCODE,
  29. principalTable: "WCS_DEVICE",
  30. principalColumn: "CODE",
  31. onDelete: ReferentialAction.Restrict);
  32. table.ForeignKey(
  33. name: "FK_WCS_PATH_WCS_DEVICE_STARTCODE",
  34. column: x => x.STARTCODE,
  35. principalTable: "WCS_DEVICE",
  36. principalColumn: "CODE",
  37. onDelete: ReferentialAction.Restrict);
  38. });
  39. migrationBuilder.CreateIndex(
  40. name: "IX_WCS_PATH_ENDCODE",
  41. table: "WCS_PATH",
  42. column: "ENDCODE");
  43. migrationBuilder.CreateIndex(
  44. name: "IX_WCS_PATH_STARTCODE",
  45. table: "WCS_PATH",
  46. column: "STARTCODE");
  47. }
  48. protected override void Down(MigrationBuilder migrationBuilder)
  49. {
  50. migrationBuilder.DropTable(
  51. name: "WCS_PATH");
  52. }
  53. }
  54. }