20220403082719_1.cs 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace WCS.Service.Migrations
  5. {
  6. public partial class _1 : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "WCS_AGVTask",
  12. columns: table => new
  13. {
  14. ID = table.Column<int>(type: "int", nullable: false)
  15. .Annotation("SqlServer:Identity", "1, 1"),
  16. AGVID = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  17. TaskType = table.Column<int>(type: "int", nullable: false),
  18. Status = table.Column<int>(type: "int", nullable: false),
  19. AGVStatus = table.Column<int>(type: "int", nullable: false),
  20. Workshop = table.Column<int>(type: "int", nullable: false),
  21. Station = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  22. Position = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  23. CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
  24. UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
  25. AGVUpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true)
  26. },
  27. constraints: table =>
  28. {
  29. table.PrimaryKey("PK_WCS_AGVTask", x => x.ID);
  30. });
  31. migrationBuilder.CreateTable(
  32. name: "WCS_CMD",
  33. columns: table => new
  34. {
  35. ID = table.Column<int>(type: "int", nullable: false)
  36. .Annotation("SqlServer:Identity", "1, 1"),
  37. DEVICE_CODE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
  38. PROTOCOL = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
  39. PROPERTY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
  40. VALUE = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
  41. WCSVERSION = table.Column<int>(type: "int", nullable: false),
  42. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  43. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  44. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  45. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  46. },
  47. constraints: table =>
  48. {
  49. table.PrimaryKey("PK_WCS_CMD", x => x.ID);
  50. });
  51. migrationBuilder.CreateTable(
  52. name: "WCS_DEVICE",
  53. columns: table => new
  54. {
  55. CODE = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  56. NAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  57. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  58. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  59. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  60. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  61. },
  62. constraints: table =>
  63. {
  64. table.PrimaryKey("PK_WCS_DEVICE", x => x.CODE);
  65. });
  66. migrationBuilder.CreateTable(
  67. name: "WCS_EXCEPTION",
  68. columns: table => new
  69. {
  70. ID = table.Column<int>(type: "int", nullable: false)
  71. .Annotation("SqlServer:Identity", "1, 1"),
  72. MSG = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
  73. STARTTIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  74. TIMES = table.Column<int>(type: "int", nullable: false),
  75. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  76. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  77. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  78. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  79. },
  80. constraints: table =>
  81. {
  82. table.PrimaryKey("PK_WCS_EXCEPTION", x => x.ID);
  83. });
  84. migrationBuilder.CreateTable(
  85. name: "WCS_MAPPINGENTRY",
  86. columns: table => new
  87. {
  88. MEP_ID = table.Column<int>(type: "int", nullable: false)
  89. .Annotation("SqlServer:Identity", "1, 1"),
  90. MEP_MAPPINGNO = table.Column<int>(type: "int", nullable: false),
  91. MEP_MAPPINGTYPE = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  92. MEP_MAPPINGCHNAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  93. MEP_ISSTOP = table.Column<bool>(type: "bit", nullable: false)
  94. },
  95. constraints: table =>
  96. {
  97. table.PrimaryKey("PK_WCS_MAPPINGENTRY", x => x.MEP_ID);
  98. });
  99. migrationBuilder.CreateTable(
  100. name: "WCS_PLC",
  101. columns: table => new
  102. {
  103. CODE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  104. NAME = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
  105. IP = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
  106. PORT = table.Column<int>(type: "int", nullable: false),
  107. SLOT = table.Column<int>(type: "int", nullable: false),
  108. RACK = table.Column<int>(type: "int", nullable: false),
  109. TYPE = table.Column<int>(type: "int", nullable: false),
  110. MODEL = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
  111. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  112. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  113. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  114. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  115. },
  116. constraints: table =>
  117. {
  118. table.PrimaryKey("PK_WCS_PLC", x => x.CODE);
  119. });
  120. migrationBuilder.CreateTable(
  121. name: "WCS_StatusLog",
  122. columns: table => new
  123. {
  124. ID = table.Column<int>(type: "int", nullable: false)
  125. .Annotation("SqlServer:Identity", "1, 1"),
  126. WCS_TASKID = table.Column<int>(type: "int", nullable: false),
  127. NewStatus = table.Column<int>(type: "int", nullable: false),
  128. OldStatus = table.Column<int>(type: "int", nullable: false),
  129. upStatus = table.Column<int>(type: "int", nullable: false),
  130. Node = table.Column<string>(type: "nvarchar(max)", nullable: false),
  131. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  132. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  133. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  134. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  135. },
  136. constraints: table =>
  137. {
  138. table.PrimaryKey("PK_WCS_StatusLog", x => x.ID);
  139. });
  140. migrationBuilder.CreateTable(
  141. name: "WCS_SystemConfig",
  142. columns: table => new
  143. {
  144. ID = table.Column<int>(type: "int", nullable: false)
  145. .Annotation("SqlServer:Identity", "1, 1"),
  146. Code = table.Column<string>(type: "nvarchar(max)", nullable: false),
  147. Describe = table.Column<string>(type: "nvarchar(max)", nullable: false),
  148. DEVICECODE = table.Column<string>(type: "nvarchar(max)", nullable: false),
  149. TUNNEL = table.Column<string>(type: "nvarchar(max)", nullable: false),
  150. Direction = table.Column<string>(type: "nvarchar(max)", nullable: false),
  151. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  152. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  153. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  154. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  155. },
  156. constraints: table =>
  157. {
  158. table.PrimaryKey("PK_WCS_SystemConfig", x => x.ID);
  159. });
  160. migrationBuilder.CreateTable(
  161. name: "WCS_TASK",
  162. columns: table => new
  163. {
  164. ID = table.Column<int>(type: "int", nullable: false)
  165. .Annotation("SqlServer:Identity", "1, 1"),
  166. BARCODE = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  167. TYPE = table.Column<int>(type: "int", nullable: false),
  168. STATUS = table.Column<int>(type: "int", nullable: false),
  169. ADDRFROM = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  170. ADDRTO = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  171. ADDRNEXT = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  172. TUNNEL = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
  173. FLOOR = table.Column<int>(type: "int", nullable: false),
  174. DEVICE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  175. SCSTATION = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  176. CREATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  177. STARTTIME = table.Column<DateTime>(type: "datetime2", nullable: true),
  178. ENDTIME = table.Column<DateTime>(type: "datetime2", nullable: true),
  179. DOCID = table.Column<int>(type: "int", nullable: false),
  180. PALLETTYPE = table.Column<short>(type: "smallint", nullable: false),
  181. PRODLINE = table.Column<short>(type: "smallint", nullable: false),
  182. FULLQTY = table.Column<short>(type: "smallint", nullable: false),
  183. HEIGHT = table.Column<short>(type: "smallint", nullable: false),
  184. WMSTASK = table.Column<int>(type: "int", nullable: false),
  185. TaskGroupKey = table.Column<string>(type: "nvarchar(max)", nullable: false),
  186. UPLOADED = table.Column<int>(type: "int", nullable: false),
  187. AgvTask = table.Column<int>(type: "int", nullable: false),
  188. Priority = table.Column<int>(type: "int", nullable: false),
  189. ManualRemarks = table.Column<string>(type: "nvarchar(max)", nullable: true),
  190. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  191. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  192. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  193. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  194. },
  195. constraints: table =>
  196. {
  197. table.PrimaryKey("PK_WCS_TASK", x => x.ID);
  198. });
  199. migrationBuilder.CreateTable(
  200. name: "WCS_Users",
  201. columns: table => new
  202. {
  203. USER_NO = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
  204. USER_PWD = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
  205. USER_TEXT = table.Column<byte[]>(type: "varbinary(max)", nullable: false)
  206. },
  207. constraints: table =>
  208. {
  209. table.PrimaryKey("PK_WCS_Users", x => x.USER_NO);
  210. });
  211. migrationBuilder.CreateTable(
  212. name: "WCS_BCR80",
  213. columns: table => new
  214. {
  215. ID = table.Column<int>(type: "int", nullable: false)
  216. .Annotation("SqlServer:Identity", "1, 1"),
  217. Content = table.Column<string>(type: "nvarchar(130)", maxLength: 130, nullable: false),
  218. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  219. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  220. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  221. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  222. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  223. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  224. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  225. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  226. },
  227. constraints: table =>
  228. {
  229. table.PrimaryKey("PK_WCS_BCR80", x => x.ID);
  230. table.ForeignKey(
  231. name: "FK_WCS_BCR80_WCS_DEVICE_DEVICECODE",
  232. column: x => x.DEVICECODE,
  233. principalTable: "WCS_DEVICE",
  234. principalColumn: "CODE");
  235. });
  236. migrationBuilder.CreateTable(
  237. name: "WCS_PATH",
  238. columns: table => new
  239. {
  240. ID = table.Column<int>(type: "int", nullable: false)
  241. .Annotation("SqlServer:Identity", "1, 1"),
  242. STARTCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  243. ENDCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  244. PATH = table.Column<string>(type: "nvarchar(max)", nullable: false),
  245. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  246. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  247. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  248. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  249. },
  250. constraints: table =>
  251. {
  252. table.PrimaryKey("PK_WCS_PATH", x => x.ID);
  253. table.ForeignKey(
  254. name: "FK_WCS_PATH_WCS_DEVICE_ENDCODE",
  255. column: x => x.ENDCODE,
  256. principalTable: "WCS_DEVICE",
  257. principalColumn: "CODE",
  258. onDelete: ReferentialAction.Restrict);
  259. table.ForeignKey(
  260. name: "FK_WCS_PATH_WCS_DEVICE_STARTCODE",
  261. column: x => x.STARTCODE,
  262. principalTable: "WCS_DEVICE",
  263. principalColumn: "CODE",
  264. onDelete: ReferentialAction.Restrict);
  265. });
  266. migrationBuilder.CreateTable(
  267. name: "WCS_PATHPOINT",
  268. columns: table => new
  269. {
  270. ID = table.Column<int>(type: "int", nullable: false)
  271. .Annotation("SqlServer:Identity", "1, 1"),
  272. STARTCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  273. ENDCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  274. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  275. PREVCODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  276. NEXTCODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  277. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  278. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  279. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  280. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  281. },
  282. constraints: table =>
  283. {
  284. table.PrimaryKey("PK_WCS_PATHPOINT", x => x.ID);
  285. table.ForeignKey(
  286. name: "FK_WCS_PATHPOINT_WCS_DEVICE_DEVICECODE",
  287. column: x => x.DEVICECODE,
  288. principalTable: "WCS_DEVICE",
  289. principalColumn: "CODE",
  290. onDelete: ReferentialAction.Restrict);
  291. table.ForeignKey(
  292. name: "FK_WCS_PATHPOINT_WCS_DEVICE_ENDCODE",
  293. column: x => x.ENDCODE,
  294. principalTable: "WCS_DEVICE",
  295. principalColumn: "CODE",
  296. onDelete: ReferentialAction.Restrict);
  297. table.ForeignKey(
  298. name: "FK_WCS_PATHPOINT_WCS_DEVICE_NEXTCODE",
  299. column: x => x.NEXTCODE,
  300. principalTable: "WCS_DEVICE",
  301. principalColumn: "CODE");
  302. table.ForeignKey(
  303. name: "FK_WCS_PATHPOINT_WCS_DEVICE_PREVCODE",
  304. column: x => x.PREVCODE,
  305. principalTable: "WCS_DEVICE",
  306. principalColumn: "CODE");
  307. table.ForeignKey(
  308. name: "FK_WCS_PATHPOINT_WCS_DEVICE_STARTCODE",
  309. column: x => x.STARTCODE,
  310. principalTable: "WCS_DEVICE",
  311. principalColumn: "CODE",
  312. onDelete: ReferentialAction.Restrict);
  313. });
  314. migrationBuilder.CreateTable(
  315. name: "WCS_RGV520",
  316. columns: table => new
  317. {
  318. ID = table.Column<int>(type: "int", nullable: false)
  319. .Annotation("SqlServer:Identity", "1, 1"),
  320. TaskID_1 = table.Column<int>(type: "int", nullable: false),
  321. TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
  322. StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  323. DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  324. Priority_1 = table.Column<short>(type: "smallint", nullable: false),
  325. RES1_1 = table.Column<short>(type: "smallint", nullable: false),
  326. RES2_1 = table.Column<short>(type: "smallint", nullable: false),
  327. Trigger_1 = table.Column<int>(type: "int", nullable: false),
  328. TaskID_2 = table.Column<int>(type: "int", nullable: false),
  329. TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
  330. StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  331. DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  332. Priority_2 = table.Column<short>(type: "smallint", nullable: false),
  333. RES1_2 = table.Column<short>(type: "smallint", nullable: false),
  334. RES2_2 = table.Column<short>(type: "smallint", nullable: false),
  335. Trigger_2 = table.Column<int>(type: "int", nullable: false),
  336. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  337. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  338. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  339. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  340. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  341. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  342. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  343. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  344. },
  345. constraints: table =>
  346. {
  347. table.PrimaryKey("PK_WCS_RGV520", x => x.ID);
  348. table.ForeignKey(
  349. name: "FK_WCS_RGV520_WCS_DEVICE_DEVICECODE",
  350. column: x => x.DEVICECODE,
  351. principalTable: "WCS_DEVICE",
  352. principalColumn: "CODE");
  353. });
  354. migrationBuilder.CreateTable(
  355. name: "WCS_RGV521",
  356. columns: table => new
  357. {
  358. ID = table.Column<int>(type: "int", nullable: false)
  359. .Annotation("SqlServer:Identity", "1, 1"),
  360. TaskID_1 = table.Column<int>(type: "int", nullable: false),
  361. TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
  362. StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  363. DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
  364. PRIORITY_1 = table.Column<short>(type: "smallint", nullable: false),
  365. RES1_1 = table.Column<short>(type: "smallint", nullable: false),
  366. RES2_1 = table.Column<short>(type: "smallint", nullable: false),
  367. PH_Status_1 = table.Column<bool>(type: "bit", nullable: false),
  368. ToSition_1 = table.Column<bool>(type: "bit", nullable: false),
  369. Finish_1 = table.Column<bool>(type: "bit", nullable: false),
  370. RES3_1 = table.Column<bool>(type: "bit", nullable: false),
  371. RES4_1 = table.Column<bool>(type: "bit", nullable: false),
  372. RES5_1 = table.Column<bool>(type: "bit", nullable: false),
  373. RES6_1 = table.Column<bool>(type: "bit", nullable: false),
  374. RES7_1 = table.Column<bool>(type: "bit", nullable: false),
  375. Trigger_1 = table.Column<int>(type: "int", nullable: false),
  376. TaskID_2 = table.Column<int>(type: "int", nullable: false),
  377. TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
  378. StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  379. DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
  380. PRIORITY_2 = table.Column<short>(type: "smallint", nullable: false),
  381. RES1_2 = table.Column<short>(type: "smallint", nullable: false),
  382. RES2_2 = table.Column<short>(type: "smallint", nullable: false),
  383. PH_Status_2 = table.Column<bool>(type: "bit", nullable: false),
  384. ToSition_2 = table.Column<bool>(type: "bit", nullable: false),
  385. Finish_2 = table.Column<bool>(type: "bit", nullable: false),
  386. RES3_2 = table.Column<bool>(type: "bit", nullable: false),
  387. RES4_2 = table.Column<bool>(type: "bit", nullable: false),
  388. RES5_2 = table.Column<bool>(type: "bit", nullable: false),
  389. RES6_2 = table.Column<bool>(type: "bit", nullable: false),
  390. RES7_2 = table.Column<bool>(type: "bit", nullable: false),
  391. Trigger_2 = table.Column<int>(type: "int", nullable: false),
  392. SystemStatus = table.Column<short>(type: "smallint", nullable: false),
  393. WorkMode = table.Column<short>(type: "smallint", nullable: false),
  394. Position = table.Column<float>(type: "real", nullable: false),
  395. Mileage = table.Column<float>(type: "real", nullable: false),
  396. Runtime = table.Column<float>(type: "real", nullable: false),
  397. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  398. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  399. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  400. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  401. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  402. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  403. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  404. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  405. },
  406. constraints: table =>
  407. {
  408. table.PrimaryKey("PK_WCS_RGV521", x => x.ID);
  409. table.ForeignKey(
  410. name: "FK_WCS_RGV521_WCS_DEVICE_DEVICECODE",
  411. column: x => x.DEVICECODE,
  412. principalTable: "WCS_DEVICE",
  413. principalColumn: "CODE");
  414. });
  415. migrationBuilder.CreateTable(
  416. name: "WCS_RGV523",
  417. columns: table => new
  418. {
  419. ID = table.Column<int>(type: "int", nullable: false)
  420. .Annotation("SqlServer:Identity", "1, 1"),
  421. Fault = table.Column<int>(type: "int", nullable: false),
  422. Fault1 = table.Column<int>(type: "int", nullable: false),
  423. Fault2 = table.Column<int>(type: "int", nullable: false),
  424. Status = table.Column<int>(type: "int", nullable: false),
  425. Status1 = table.Column<int>(type: "int", nullable: false),
  426. Status2 = table.Column<int>(type: "int", nullable: false),
  427. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  428. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  429. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  430. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  431. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  432. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  433. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  434. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  435. },
  436. constraints: table =>
  437. {
  438. table.PrimaryKey("PK_WCS_RGV523", x => x.ID);
  439. table.ForeignKey(
  440. name: "FK_WCS_RGV523_WCS_DEVICE_DEVICECODE",
  441. column: x => x.DEVICECODE,
  442. principalTable: "WCS_DEVICE",
  443. principalColumn: "CODE");
  444. });
  445. migrationBuilder.CreateTable(
  446. name: "WCS_ROUTE",
  447. columns: table => new
  448. {
  449. ID = table.Column<int>(type: "int", nullable: false)
  450. .Annotation("SqlServer:Identity", "1, 1"),
  451. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  452. NEXTCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  453. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  454. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  455. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  456. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  457. },
  458. constraints: table =>
  459. {
  460. table.PrimaryKey("PK_WCS_ROUTE", x => x.ID);
  461. table.ForeignKey(
  462. name: "FK_WCS_ROUTE_WCS_DEVICE_DEVICECODE",
  463. column: x => x.DEVICECODE,
  464. principalTable: "WCS_DEVICE",
  465. principalColumn: "CODE",
  466. onDelete: ReferentialAction.Restrict);
  467. table.ForeignKey(
  468. name: "FK_WCS_ROUTE_WCS_DEVICE_NEXTCODE",
  469. column: x => x.NEXTCODE,
  470. principalTable: "WCS_DEVICE",
  471. principalColumn: "CODE",
  472. onDelete: ReferentialAction.Restrict);
  473. });
  474. migrationBuilder.CreateTable(
  475. name: "WCS_STATION50",
  476. columns: table => new
  477. {
  478. ID = table.Column<int>(type: "int", nullable: false)
  479. .Annotation("SqlServer:Identity", "1, 1"),
  480. S_TaskId = table.Column<int>(type: "int", nullable: false),
  481. S_GoodsCode = table.Column<int>(type: "int", nullable: false),
  482. S_GoodsType = table.Column<short>(type: "smallint", nullable: false),
  483. S_GoodsSize = table.Column<short>(type: "smallint", nullable: false),
  484. S_GoodsStart = table.Column<short>(type: "smallint", nullable: false),
  485. S_GoodsEnd = table.Column<short>(type: "smallint", nullable: false),
  486. S_Height = table.Column<short>(type: "smallint", nullable: false),
  487. G_TaskId = table.Column<int>(type: "int", nullable: false),
  488. G_GoodsStart = table.Column<short>(type: "smallint", nullable: false),
  489. G_GoodsEnd = table.Column<short>(type: "smallint", nullable: false),
  490. G_GoodsCode = table.Column<int>(type: "int", nullable: false),
  491. G_GoodsType = table.Column<short>(type: "smallint", nullable: false),
  492. G_GoodsSize = table.Column<short>(type: "smallint", nullable: false),
  493. G_Height = table.Column<short>(type: "smallint", nullable: false),
  494. S_Confirm = table.Column<bool>(type: "bit", nullable: false),
  495. G_Station_Ready = table.Column<bool>(type: "bit", nullable: false),
  496. S_TaskDelete = table.Column<bool>(type: "bit", nullable: false),
  497. G_Notask = table.Column<bool>(type: "bit", nullable: false),
  498. G_PhStatus = table.Column<bool>(type: "bit", nullable: false),
  499. G_Request = table.Column<bool>(type: "bit", nullable: false),
  500. G_GoodsError = table.Column<bool>(type: "bit", nullable: false),
  501. G_F_Outside = table.Column<bool>(type: "bit", nullable: false),
  502. G_B_Outside = table.Column<bool>(type: "bit", nullable: false),
  503. G_L_Outside = table.Column<bool>(type: "bit", nullable: false),
  504. G_R_Outside = table.Column<bool>(type: "bit", nullable: false),
  505. G_H_Outside = table.Column<bool>(type: "bit", nullable: false),
  506. G_BCR_NoRead = table.Column<bool>(type: "bit", nullable: false),
  507. G_Overload = table.Column<bool>(type: "bit", nullable: false),
  508. S_AGV_Put_OK = table.Column<bool>(type: "bit", nullable: false),
  509. S_AGV_Get_OK = table.Column<bool>(type: "bit", nullable: false),
  510. G_Weight = table.Column<short>(type: "smallint", nullable: false),
  511. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  512. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  513. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  514. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  515. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  516. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  517. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  518. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  519. },
  520. constraints: table =>
  521. {
  522. table.PrimaryKey("PK_WCS_STATION50", x => x.ID);
  523. table.ForeignKey(
  524. name: "FK_WCS_STATION50_WCS_DEVICE_DEVICECODE",
  525. column: x => x.DEVICECODE,
  526. principalTable: "WCS_DEVICE",
  527. principalColumn: "CODE");
  528. });
  529. migrationBuilder.CreateTable(
  530. name: "WCS_STATION70",
  531. columns: table => new
  532. {
  533. ID = table.Column<int>(type: "int", nullable: false)
  534. .Annotation("SqlServer:Identity", "1, 1"),
  535. Alarm = table.Column<int>(type: "int", nullable: false),
  536. RES = table.Column<short>(type: "smallint", nullable: false),
  537. Status = table.Column<int>(type: "int", nullable: false),
  538. RunTime = table.Column<float>(type: "real", nullable: false),
  539. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  540. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  541. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  542. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  543. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  544. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  545. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  546. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  547. },
  548. constraints: table =>
  549. {
  550. table.PrimaryKey("PK_WCS_STATION70", x => x.ID);
  551. table.ForeignKey(
  552. name: "FK_WCS_STATION70_WCS_DEVICE_DEVICECODE",
  553. column: x => x.DEVICECODE,
  554. principalTable: "WCS_DEVICE",
  555. principalColumn: "CODE");
  556. });
  557. migrationBuilder.CreateTable(
  558. name: "WCS_DATABLOCK",
  559. columns: table => new
  560. {
  561. CODE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  562. NAME = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
  563. PLCCODE = table.Column<string>(type: "nvarchar(20)", nullable: true),
  564. NO = table.Column<int>(type: "int", nullable: false),
  565. LENGTH = table.Column<int>(type: "int", nullable: false),
  566. DATALENGTH = table.Column<int>(type: "int", nullable: false),
  567. PROTOCOL = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
  568. NOUPDATE = table.Column<bool>(type: "bit", nullable: false),
  569. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  570. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  571. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  572. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  573. },
  574. constraints: table =>
  575. {
  576. table.PrimaryKey("PK_WCS_DATABLOCK", x => x.CODE);
  577. table.ForeignKey(
  578. name: "FK_WCS_DATABLOCK_WCS_PLC_PLCCODE",
  579. column: x => x.PLCCODE,
  580. principalTable: "WCS_PLC",
  581. principalColumn: "CODE");
  582. });
  583. migrationBuilder.CreateTable(
  584. name: "WCS_DEVICEPROTOCOL",
  585. columns: table => new
  586. {
  587. ID = table.Column<int>(type: "int", nullable: false)
  588. .Annotation("SqlServer:Identity", "1, 1"),
  589. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
  590. DBCODE = table.Column<string>(type: "nvarchar(20)", nullable: false),
  591. POSITION = table.Column<short>(type: "smallint", nullable: false),
  592. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  593. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  594. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  595. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  596. },
  597. constraints: table =>
  598. {
  599. table.PrimaryKey("PK_WCS_DEVICEPROTOCOL", x => x.ID);
  600. table.ForeignKey(
  601. name: "FK_WCS_DEVICEPROTOCOL_WCS_DATABLOCK_DBCODE",
  602. column: x => x.DBCODE,
  603. principalTable: "WCS_DATABLOCK",
  604. principalColumn: "CODE",
  605. onDelete: ReferentialAction.Restrict);
  606. table.ForeignKey(
  607. name: "FK_WCS_DEVICEPROTOCOL_WCS_DEVICE_DEVICECODE",
  608. column: x => x.DEVICECODE,
  609. principalTable: "WCS_DEVICE",
  610. principalColumn: "CODE",
  611. onDelete: ReferentialAction.Restrict);
  612. });
  613. migrationBuilder.CreateIndex(
  614. name: "IX_WCS_BCR80_DEVICECODE",
  615. table: "WCS_BCR80",
  616. column: "DEVICECODE");
  617. migrationBuilder.CreateIndex(
  618. name: "IX_WCS_DATABLOCK_PLCCODE",
  619. table: "WCS_DATABLOCK",
  620. column: "PLCCODE");
  621. migrationBuilder.CreateIndex(
  622. name: "IX_WCS_DEVICEPROTOCOL_DBCODE",
  623. table: "WCS_DEVICEPROTOCOL",
  624. column: "DBCODE");
  625. migrationBuilder.CreateIndex(
  626. name: "IX_WCS_DEVICEPROTOCOL_DEVICECODE",
  627. table: "WCS_DEVICEPROTOCOL",
  628. column: "DEVICECODE");
  629. migrationBuilder.CreateIndex(
  630. name: "IX_WCS_PATH_ENDCODE",
  631. table: "WCS_PATH",
  632. column: "ENDCODE");
  633. migrationBuilder.CreateIndex(
  634. name: "IX_WCS_PATH_STARTCODE",
  635. table: "WCS_PATH",
  636. column: "STARTCODE");
  637. migrationBuilder.CreateIndex(
  638. name: "IX_WCS_PATHPOINT_DEVICECODE",
  639. table: "WCS_PATHPOINT",
  640. column: "DEVICECODE");
  641. migrationBuilder.CreateIndex(
  642. name: "IX_WCS_PATHPOINT_ENDCODE",
  643. table: "WCS_PATHPOINT",
  644. column: "ENDCODE");
  645. migrationBuilder.CreateIndex(
  646. name: "IX_WCS_PATHPOINT_NEXTCODE",
  647. table: "WCS_PATHPOINT",
  648. column: "NEXTCODE");
  649. migrationBuilder.CreateIndex(
  650. name: "IX_WCS_PATHPOINT_PREVCODE",
  651. table: "WCS_PATHPOINT",
  652. column: "PREVCODE");
  653. migrationBuilder.CreateIndex(
  654. name: "IX_WCS_PATHPOINT_STARTCODE",
  655. table: "WCS_PATHPOINT",
  656. column: "STARTCODE");
  657. migrationBuilder.CreateIndex(
  658. name: "IX_WCS_RGV520_DEVICECODE",
  659. table: "WCS_RGV520",
  660. column: "DEVICECODE");
  661. migrationBuilder.CreateIndex(
  662. name: "IX_WCS_RGV521_DEVICECODE",
  663. table: "WCS_RGV521",
  664. column: "DEVICECODE");
  665. migrationBuilder.CreateIndex(
  666. name: "IX_WCS_RGV523_DEVICECODE",
  667. table: "WCS_RGV523",
  668. column: "DEVICECODE");
  669. migrationBuilder.CreateIndex(
  670. name: "IX_WCS_ROUTE_DEVICECODE",
  671. table: "WCS_ROUTE",
  672. column: "DEVICECODE");
  673. migrationBuilder.CreateIndex(
  674. name: "IX_WCS_ROUTE_NEXTCODE",
  675. table: "WCS_ROUTE",
  676. column: "NEXTCODE");
  677. migrationBuilder.CreateIndex(
  678. name: "IX_WCS_STATION50_DEVICECODE",
  679. table: "WCS_STATION50",
  680. column: "DEVICECODE");
  681. migrationBuilder.CreateIndex(
  682. name: "IX_WCS_STATION70_DEVICECODE",
  683. table: "WCS_STATION70",
  684. column: "DEVICECODE");
  685. }
  686. protected override void Down(MigrationBuilder migrationBuilder)
  687. {
  688. migrationBuilder.DropTable(
  689. name: "WCS_AGVTask");
  690. migrationBuilder.DropTable(
  691. name: "WCS_BCR80");
  692. migrationBuilder.DropTable(
  693. name: "WCS_CMD");
  694. migrationBuilder.DropTable(
  695. name: "WCS_DEVICEPROTOCOL");
  696. migrationBuilder.DropTable(
  697. name: "WCS_EXCEPTION");
  698. migrationBuilder.DropTable(
  699. name: "WCS_MAPPINGENTRY");
  700. migrationBuilder.DropTable(
  701. name: "WCS_PATH");
  702. migrationBuilder.DropTable(
  703. name: "WCS_PATHPOINT");
  704. migrationBuilder.DropTable(
  705. name: "WCS_RGV520");
  706. migrationBuilder.DropTable(
  707. name: "WCS_RGV521");
  708. migrationBuilder.DropTable(
  709. name: "WCS_RGV523");
  710. migrationBuilder.DropTable(
  711. name: "WCS_ROUTE");
  712. migrationBuilder.DropTable(
  713. name: "WCS_STATION50");
  714. migrationBuilder.DropTable(
  715. name: "WCS_STATION70");
  716. migrationBuilder.DropTable(
  717. name: "WCS_StatusLog");
  718. migrationBuilder.DropTable(
  719. name: "WCS_SystemConfig");
  720. migrationBuilder.DropTable(
  721. name: "WCS_TASK");
  722. migrationBuilder.DropTable(
  723. name: "WCS_Users");
  724. migrationBuilder.DropTable(
  725. name: "WCS_DATABLOCK");
  726. migrationBuilder.DropTable(
  727. name: "WCS_DEVICE");
  728. migrationBuilder.DropTable(
  729. name: "WCS_PLC");
  730. }
  731. }
  732. }