20220411053132_8.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace WCS.Service.Migrations
  5. {
  6. public partial class _8 : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.RenameColumn(
  11. name: "SCSTATION",
  12. table: "WCS_TASK",
  13. newName: "SRMSTATION");
  14. migrationBuilder.CreateTable(
  15. name: "WCS_SRM520",
  16. columns: table => new
  17. {
  18. ID = table.Column<int>(type: "int", nullable: false)
  19. .Annotation("SqlServer:Identity", "1, 1"),
  20. Handshake_1 = table.Column<short>(type: "smallint", nullable: false),
  21. RES1_1 = table.Column<short>(type: "smallint", nullable: false),
  22. RES2_1 = table.Column<short>(type: "smallint", nullable: false),
  23. GoodsType_1 = table.Column<short>(type: "smallint", nullable: false),
  24. SpeedMode_1 = table.Column<short>(type: "smallint", nullable: false),
  25. SLine_1 = table.Column<short>(type: "smallint", nullable: false),
  26. SCol_1 = table.Column<short>(type: "smallint", nullable: false),
  27. SLayer_1 = table.Column<short>(type: "smallint", nullable: false),
  28. SDepth_1 = table.Column<short>(type: "smallint", nullable: false),
  29. ELine_1 = table.Column<short>(type: "smallint", nullable: false),
  30. ECol_1 = table.Column<short>(type: "smallint", nullable: false),
  31. ELayer_1 = table.Column<short>(type: "smallint", nullable: false),
  32. EDepth_1 = table.Column<short>(type: "smallint", nullable: false),
  33. TaskID_1 = table.Column<int>(type: "int", nullable: false),
  34. VoucherNo_1 = table.Column<short>(type: "smallint", nullable: false),
  35. FinishedACK_1 = table.Column<short>(type: "smallint", nullable: false),
  36. RES3_1 = table.Column<short>(type: "smallint", nullable: false),
  37. RES4_1 = table.Column<short>(type: "smallint", nullable: false),
  38. Handshake_2 = table.Column<short>(type: "smallint", nullable: false),
  39. RES1_2 = table.Column<short>(type: "smallint", nullable: false),
  40. RES2_2 = table.Column<short>(type: "smallint", nullable: false),
  41. GoodsType_2 = table.Column<short>(type: "smallint", nullable: false),
  42. SCSpeedMode_2 = table.Column<short>(type: "smallint", nullable: false),
  43. SLine_2 = table.Column<short>(type: "smallint", nullable: false),
  44. SCol_2 = table.Column<short>(type: "smallint", nullable: false),
  45. SLayer_2 = table.Column<short>(type: "smallint", nullable: false),
  46. SDepth_2 = table.Column<short>(type: "smallint", nullable: false),
  47. ELine_2 = table.Column<short>(type: "smallint", nullable: false),
  48. ECol_2 = table.Column<short>(type: "smallint", nullable: false),
  49. ELayer_2 = table.Column<short>(type: "smallint", nullable: false),
  50. EDepth_2 = table.Column<short>(type: "smallint", nullable: false),
  51. TaskID_2 = table.Column<int>(type: "int", nullable: false),
  52. VoucherNo_2 = table.Column<short>(type: "smallint", nullable: false),
  53. FinishedACK_2 = table.Column<short>(type: "smallint", nullable: false),
  54. RES3_2 = table.Column<short>(type: "smallint", nullable: false),
  55. RES4_2 = table.Column<short>(type: "smallint", nullable: false),
  56. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  57. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  58. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  59. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  60. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  61. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  62. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  63. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  64. },
  65. constraints: table =>
  66. {
  67. table.PrimaryKey("PK_WCS_SRM520", x => x.ID);
  68. table.ForeignKey(
  69. name: "FK_WCS_SRM520_WCS_DEVICE_DEVICECODE",
  70. column: x => x.DEVICECODE,
  71. principalTable: "WCS_DEVICE",
  72. principalColumn: "CODE");
  73. });
  74. migrationBuilder.CreateTable(
  75. name: "WCS_SRM521",
  76. columns: table => new
  77. {
  78. ID = table.Column<int>(type: "int", nullable: false)
  79. .Annotation("SqlServer:Identity", "1, 1"),
  80. ForkStatus_1 = table.Column<long>(type: "bigint", nullable: false),
  81. Mode_1 = table.Column<short>(type: "smallint", nullable: false),
  82. Status_1 = table.Column<short>(type: "smallint", nullable: false),
  83. SLine_1 = table.Column<short>(type: "smallint", nullable: false),
  84. SCol_1 = table.Column<short>(type: "smallint", nullable: false),
  85. SLayer_1 = table.Column<short>(type: "smallint", nullable: false),
  86. SDepth_1 = table.Column<short>(type: "smallint", nullable: false),
  87. ELine_1 = table.Column<short>(type: "smallint", nullable: false),
  88. ECol_1 = table.Column<short>(type: "smallint", nullable: false),
  89. ELayer_1 = table.Column<short>(type: "smallint", nullable: false),
  90. EDepth_1 = table.Column<short>(type: "smallint", nullable: false),
  91. TaskID_1 = table.Column<int>(type: "int", nullable: false),
  92. VoucherNo_1 = table.Column<short>(type: "smallint", nullable: false),
  93. Line_1 = table.Column<short>(type: "smallint", nullable: false),
  94. Col_1 = table.Column<short>(type: "smallint", nullable: false),
  95. Layer_1 = table.Column<short>(type: "smallint", nullable: false),
  96. FinishedTask_1 = table.Column<int>(type: "int", nullable: false),
  97. TravelPos_1 = table.Column<int>(type: "int", nullable: false),
  98. LiftPos_1 = table.Column<int>(type: "int", nullable: false),
  99. ForkPos_1 = table.Column<int>(type: "int", nullable: false),
  100. RES9_1 = table.Column<short>(type: "smallint", nullable: false),
  101. RES10_1 = table.Column<short>(type: "smallint", nullable: false),
  102. TotalKM_1 = table.Column<float>(type: "real", nullable: false),
  103. GoodsType_1 = table.Column<short>(type: "smallint", nullable: false),
  104. Runtime_1 = table.Column<float>(type: "real", nullable: false),
  105. RES11_1 = table.Column<int>(type: "int", nullable: false),
  106. RES12_1 = table.Column<int>(type: "int", nullable: false),
  107. RES13_1 = table.Column<int>(type: "int", nullable: false),
  108. RES14_1 = table.Column<int>(type: "int", nullable: false),
  109. ForkStatus_2 = table.Column<long>(type: "bigint", nullable: false),
  110. Mode_2 = table.Column<short>(type: "smallint", nullable: false),
  111. Status_2 = table.Column<short>(type: "smallint", nullable: false),
  112. SLine_2 = table.Column<short>(type: "smallint", nullable: false),
  113. SCol_2 = table.Column<short>(type: "smallint", nullable: false),
  114. SLayer_2 = table.Column<short>(type: "smallint", nullable: false),
  115. SDepth_2 = table.Column<short>(type: "smallint", nullable: false),
  116. ELine_2 = table.Column<short>(type: "smallint", nullable: false),
  117. ECol_2 = table.Column<short>(type: "smallint", nullable: false),
  118. ELayer_2 = table.Column<short>(type: "smallint", nullable: false),
  119. EDepth_2 = table.Column<short>(type: "smallint", nullable: false),
  120. TaskID_2 = table.Column<int>(type: "int", nullable: false),
  121. VoucherNo_2 = table.Column<short>(type: "smallint", nullable: false),
  122. Line_2 = table.Column<short>(type: "smallint", nullable: false),
  123. Col_2 = table.Column<short>(type: "smallint", nullable: false),
  124. Layer_2 = table.Column<short>(type: "smallint", nullable: false),
  125. FinishedTask_2 = table.Column<int>(type: "int", nullable: false),
  126. TravelPos_2 = table.Column<int>(type: "int", nullable: false),
  127. LiftPos_2 = table.Column<int>(type: "int", nullable: false),
  128. ForkPos_2 = table.Column<int>(type: "int", nullable: false),
  129. RES9_2 = table.Column<short>(type: "smallint", nullable: false),
  130. RES10_2 = table.Column<short>(type: "smallint", nullable: false),
  131. TotalKM_2 = table.Column<float>(type: "real", nullable: false),
  132. GoodsType_2 = table.Column<short>(type: "smallint", nullable: false),
  133. Runtime_2 = table.Column<float>(type: "real", nullable: false),
  134. RES11_2 = table.Column<int>(type: "int", nullable: false),
  135. RES12_2 = table.Column<int>(type: "int", nullable: false),
  136. RES13_2 = table.Column<int>(type: "int", nullable: false),
  137. RES14_2 = table.Column<int>(type: "int", nullable: false),
  138. SRMMode = table.Column<short>(type: "smallint", nullable: false),
  139. SRMStatus = table.Column<short>(type: "smallint", nullable: false),
  140. TotalKM = table.Column<float>(type: "real", nullable: false),
  141. Runtime = table.Column<float>(type: "real", nullable: false),
  142. Alarm = table.Column<short>(type: "smallint", nullable: false),
  143. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  144. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  145. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  146. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  147. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  148. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  149. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  150. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  151. },
  152. constraints: table =>
  153. {
  154. table.PrimaryKey("PK_WCS_SRM521", x => x.ID);
  155. table.ForeignKey(
  156. name: "FK_WCS_SRM521_WCS_DEVICE_DEVICECODE",
  157. column: x => x.DEVICECODE,
  158. principalTable: "WCS_DEVICE",
  159. principalColumn: "CODE");
  160. });
  161. migrationBuilder.CreateTable(
  162. name: "WCS_SRM537",
  163. columns: table => new
  164. {
  165. ID = table.Column<int>(type: "int", nullable: false)
  166. .Annotation("SqlServer:Identity", "1, 1"),
  167. SCAlarm = table.Column<decimal>(type: "decimal(20,0)", nullable: false),
  168. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  169. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  170. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  171. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  172. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  173. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  174. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  175. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  176. },
  177. constraints: table =>
  178. {
  179. table.PrimaryKey("PK_WCS_SRM537", x => x.ID);
  180. table.ForeignKey(
  181. name: "FK_WCS_SRM537_WCS_DEVICE_DEVICECODE",
  182. column: x => x.DEVICECODE,
  183. principalTable: "WCS_DEVICE",
  184. principalColumn: "CODE");
  185. });
  186. migrationBuilder.CreateIndex(
  187. name: "IX_WCS_SRM520_DEVICECODE",
  188. table: "WCS_SRM520",
  189. column: "DEVICECODE");
  190. migrationBuilder.CreateIndex(
  191. name: "IX_WCS_SRM521_DEVICECODE",
  192. table: "WCS_SRM521",
  193. column: "DEVICECODE");
  194. migrationBuilder.CreateIndex(
  195. name: "IX_WCS_SRM537_DEVICECODE",
  196. table: "WCS_SRM537",
  197. column: "DEVICECODE");
  198. }
  199. protected override void Down(MigrationBuilder migrationBuilder)
  200. {
  201. migrationBuilder.DropTable(
  202. name: "WCS_SRM520");
  203. migrationBuilder.DropTable(
  204. name: "WCS_SRM521");
  205. migrationBuilder.DropTable(
  206. name: "WCS_SRM537");
  207. migrationBuilder.RenameColumn(
  208. name: "SRMSTATION",
  209. table: "WCS_TASK",
  210. newName: "SCSTATION");
  211. }
  212. }
  213. }