20221003063033_双工位RGV.cs 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace WCS.Service.Migrations
  4. {
  5. public partial class 双工位RGV : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "WCS_DRGV520",
  11. columns: table => new
  12. {
  13. ID = table.Column<int>(type: "int", nullable: false)
  14. .Annotation("SqlServer:Identity", "1, 1"),
  15. TaskID_1 = table.Column<int>(type: "int", nullable: false),
  16. TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
  17. StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  18. DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  19. PRIORITY_1 = table.Column<short>(type: "smallint", nullable: false),
  20. RES1_1 = table.Column<short>(type: "smallint", nullable: false),
  21. res2_1 = table.Column<short>(type: "smallint", nullable: false),
  22. Trigger_1 = table.Column<short>(type: "smallint", nullable: false),
  23. TaskID_2 = table.Column<int>(type: "int", nullable: false),
  24. TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
  25. StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  26. DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  27. PRIORITY_2 = table.Column<short>(type: "smallint", nullable: false),
  28. RES1_2 = table.Column<short>(type: "smallint", nullable: false),
  29. res2_2 = table.Column<short>(type: "smallint", nullable: false),
  30. Trigger_2 = table.Column<short>(type: "smallint", nullable: false),
  31. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  32. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  33. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  34. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  35. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  36. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  37. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  38. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  39. },
  40. constraints: table =>
  41. {
  42. table.PrimaryKey("PK_WCS_DRGV520", x => x.ID);
  43. table.ForeignKey(
  44. name: "FK_WCS_DRGV520_WCS_DEVICE_DEVICECODE",
  45. column: x => x.DEVICECODE,
  46. principalTable: "WCS_DEVICE",
  47. principalColumn: "CODE",
  48. onDelete: ReferentialAction.Restrict);
  49. });
  50. migrationBuilder.CreateTable(
  51. name: "WCS_DRGV521",
  52. columns: table => new
  53. {
  54. ID = table.Column<int>(type: "int", nullable: false)
  55. .Annotation("SqlServer:Identity", "1, 1"),
  56. TaskID_1 = table.Column<int>(type: "int", nullable: false),
  57. TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
  58. StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  59. DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  60. PRIORITY_1 = table.Column<short>(type: "smallint", nullable: false),
  61. ACT_V_1 = table.Column<short>(type: "smallint", nullable: false),
  62. RES2_1 = table.Column<short>(type: "smallint", nullable: false),
  63. PH_Status_1 = table.Column<bool>(type: "bit", nullable: false),
  64. ToSition_1 = table.Column<bool>(type: "bit", nullable: false),
  65. Finish_1 = table.Column<bool>(type: "bit", nullable: false),
  66. TaskID_2 = table.Column<int>(type: "int", nullable: false),
  67. TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
  68. StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  69. DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  70. PRIORITY_2 = table.Column<short>(type: "smallint", nullable: false),
  71. ACT_V_2 = table.Column<short>(type: "smallint", nullable: false),
  72. RES2_2 = table.Column<short>(type: "smallint", nullable: false),
  73. PH_Status_2 = table.Column<bool>(type: "bit", nullable: false),
  74. ToSition_2 = table.Column<bool>(type: "bit", nullable: false),
  75. Finish_2 = table.Column<bool>(type: "bit", nullable: false),
  76. SystemStatus = table.Column<short>(type: "smallint", nullable: false),
  77. WorkMode = table.Column<short>(type: "smallint", nullable: false),
  78. RES = table.Column<short>(type: "smallint", nullable: false),
  79. Position = table.Column<float>(type: "real", nullable: false),
  80. Mileage = table.Column<float>(type: "real", nullable: false),
  81. Runtime = table.Column<float>(type: "real", nullable: false),
  82. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  83. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  84. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  85. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  86. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  87. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  88. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  89. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  90. },
  91. constraints: table =>
  92. {
  93. table.PrimaryKey("PK_WCS_DRGV521", x => x.ID);
  94. table.ForeignKey(
  95. name: "FK_WCS_DRGV521_WCS_DEVICE_DEVICECODE",
  96. column: x => x.DEVICECODE,
  97. principalTable: "WCS_DEVICE",
  98. principalColumn: "CODE",
  99. onDelete: ReferentialAction.Restrict);
  100. });
  101. migrationBuilder.CreateTable(
  102. name: "WCS_DRGV523",
  103. columns: table => new
  104. {
  105. ID = table.Column<int>(type: "int", nullable: false)
  106. .Annotation("SqlServer:Identity", "1, 1"),
  107. Fault = table.Column<int>(type: "int", nullable: false),
  108. Fault1 = table.Column<int>(type: "int", nullable: false),
  109. Fault2 = table.Column<int>(type: "int", nullable: false),
  110. Status = table.Column<int>(type: "int", nullable: false),
  111. Status1 = table.Column<int>(type: "int", nullable: false),
  112. Status2 = table.Column<int>(type: "int", nullable: false),
  113. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  114. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  115. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  116. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  117. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  118. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  119. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  120. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  121. },
  122. constraints: table =>
  123. {
  124. table.PrimaryKey("PK_WCS_DRGV523", x => x.ID);
  125. table.ForeignKey(
  126. name: "FK_WCS_DRGV523_WCS_DEVICE_DEVICECODE",
  127. column: x => x.DEVICECODE,
  128. principalTable: "WCS_DEVICE",
  129. principalColumn: "CODE",
  130. onDelete: ReferentialAction.Restrict);
  131. });
  132. migrationBuilder.CreateIndex(
  133. name: "IX_WCS_DRGV520_DEVICECODE",
  134. table: "WCS_DRGV520",
  135. column: "DEVICECODE");
  136. migrationBuilder.CreateIndex(
  137. name: "IX_WCS_DRGV521_DEVICECODE",
  138. table: "WCS_DRGV521",
  139. column: "DEVICECODE");
  140. migrationBuilder.CreateIndex(
  141. name: "IX_WCS_DRGV523_DEVICECODE",
  142. table: "WCS_DRGV523",
  143. column: "DEVICECODE");
  144. }
  145. protected override void Down(MigrationBuilder migrationBuilder)
  146. {
  147. migrationBuilder.DropTable(
  148. name: "WCS_DRGV520");
  149. migrationBuilder.DropTable(
  150. name: "WCS_DRGV521");
  151. migrationBuilder.DropTable(
  152. name: "WCS_DRGV523");
  153. }
  154. }
  155. }