20220404090945_3.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace WCS.Service.Migrations
  5. {
  6. public partial class _3 : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.DropForeignKey(
  11. name: "FK_WCS_STATION50_WCS_DEVICE_DEVICECODE",
  12. table: "WCS_STATION50");
  13. migrationBuilder.DropForeignKey(
  14. name: "FK_WCS_STATION70_WCS_DEVICE_DEVICECODE",
  15. table: "WCS_STATION70");
  16. migrationBuilder.DropPrimaryKey(
  17. name: "PK_WCS_STATION70",
  18. table: "WCS_STATION70");
  19. migrationBuilder.DropPrimaryKey(
  20. name: "PK_WCS_STATION50",
  21. table: "WCS_STATION50");
  22. migrationBuilder.RenameTable(
  23. name: "WCS_STATION70",
  24. newName: "WCS_STATION523");
  25. migrationBuilder.RenameTable(
  26. name: "WCS_STATION50",
  27. newName: "WCS_STATION520");
  28. migrationBuilder.RenameIndex(
  29. name: "IX_WCS_STATION70_DEVICECODE",
  30. table: "WCS_STATION523",
  31. newName: "IX_WCS_STATION523_DEVICECODE");
  32. migrationBuilder.RenameIndex(
  33. name: "IX_WCS_STATION50_DEVICECODE",
  34. table: "WCS_STATION520",
  35. newName: "IX_WCS_STATION520_DEVICECODE");
  36. migrationBuilder.AddPrimaryKey(
  37. name: "PK_WCS_STATION523",
  38. table: "WCS_STATION523",
  39. column: "ID");
  40. migrationBuilder.AddPrimaryKey(
  41. name: "PK_WCS_STATION520",
  42. table: "WCS_STATION520",
  43. column: "ID");
  44. migrationBuilder.CreateTable(
  45. name: "WCS_STATION521",
  46. columns: table => new
  47. {
  48. ID = table.Column<int>(type: "int", nullable: false)
  49. .Annotation("SqlServer:Identity", "1, 1"),
  50. Tasknum = table.Column<int>(type: "int", nullable: false),
  51. Goodscode = table.Column<int>(type: "int", nullable: false),
  52. Goodsnum = table.Column<short>(type: "smallint", nullable: false),
  53. GoodsSize = table.Column<short>(type: "smallint", nullable: false),
  54. Goodsstart = table.Column<short>(type: "smallint", nullable: false),
  55. Goodsend = table.Column<short>(type: "smallint", nullable: false),
  56. Request = table.Column<short>(type: "smallint", nullable: false),
  57. CmdType = table.Column<short>(type: "smallint", nullable: false),
  58. VoucherNo = table.Column<short>(type: "smallint", nullable: false),
  59. Istation521Status = table.Column<int>(type: "int", nullable: false),
  60. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  61. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  62. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  63. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
  64. DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
  65. FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
  66. ISLAST = table.Column<bool>(type: "bit", nullable: false),
  67. WCSVERSION = table.Column<int>(type: "int", nullable: false)
  68. },
  69. constraints: table =>
  70. {
  71. table.PrimaryKey("PK_WCS_STATION521", x => x.ID);
  72. table.ForeignKey(
  73. name: "FK_WCS_STATION521_WCS_DEVICE_DEVICECODE",
  74. column: x => x.DEVICECODE,
  75. principalTable: "WCS_DEVICE",
  76. principalColumn: "CODE");
  77. });
  78. migrationBuilder.CreateIndex(
  79. name: "IX_WCS_STATION521_DEVICECODE",
  80. table: "WCS_STATION521",
  81. column: "DEVICECODE");
  82. migrationBuilder.AddForeignKey(
  83. name: "FK_WCS_STATION520_WCS_DEVICE_DEVICECODE",
  84. table: "WCS_STATION520",
  85. column: "DEVICECODE",
  86. principalTable: "WCS_DEVICE",
  87. principalColumn: "CODE");
  88. migrationBuilder.AddForeignKey(
  89. name: "FK_WCS_STATION523_WCS_DEVICE_DEVICECODE",
  90. table: "WCS_STATION523",
  91. column: "DEVICECODE",
  92. principalTable: "WCS_DEVICE",
  93. principalColumn: "CODE");
  94. }
  95. protected override void Down(MigrationBuilder migrationBuilder)
  96. {
  97. migrationBuilder.DropForeignKey(
  98. name: "FK_WCS_STATION520_WCS_DEVICE_DEVICECODE",
  99. table: "WCS_STATION520");
  100. migrationBuilder.DropForeignKey(
  101. name: "FK_WCS_STATION523_WCS_DEVICE_DEVICECODE",
  102. table: "WCS_STATION523");
  103. migrationBuilder.DropTable(
  104. name: "WCS_STATION521");
  105. migrationBuilder.DropPrimaryKey(
  106. name: "PK_WCS_STATION523",
  107. table: "WCS_STATION523");
  108. migrationBuilder.DropPrimaryKey(
  109. name: "PK_WCS_STATION520",
  110. table: "WCS_STATION520");
  111. migrationBuilder.RenameTable(
  112. name: "WCS_STATION523",
  113. newName: "WCS_STATION70");
  114. migrationBuilder.RenameTable(
  115. name: "WCS_STATION520",
  116. newName: "WCS_STATION50");
  117. migrationBuilder.RenameIndex(
  118. name: "IX_WCS_STATION523_DEVICECODE",
  119. table: "WCS_STATION70",
  120. newName: "IX_WCS_STATION70_DEVICECODE");
  121. migrationBuilder.RenameIndex(
  122. name: "IX_WCS_STATION520_DEVICECODE",
  123. table: "WCS_STATION50",
  124. newName: "IX_WCS_STATION50_DEVICECODE");
  125. migrationBuilder.AddPrimaryKey(
  126. name: "PK_WCS_STATION70",
  127. table: "WCS_STATION70",
  128. column: "ID");
  129. migrationBuilder.AddPrimaryKey(
  130. name: "PK_WCS_STATION50",
  131. table: "WCS_STATION50",
  132. column: "ID");
  133. migrationBuilder.AddForeignKey(
  134. name: "FK_WCS_STATION50_WCS_DEVICE_DEVICECODE",
  135. table: "WCS_STATION50",
  136. column: "DEVICECODE",
  137. principalTable: "WCS_DEVICE",
  138. principalColumn: "CODE");
  139. migrationBuilder.AddForeignKey(
  140. name: "FK_WCS_STATION70_WCS_DEVICE_DEVICECODE",
  141. table: "WCS_STATION70",
  142. column: "DEVICECODE",
  143. principalTable: "WCS_DEVICE",
  144. principalColumn: "CODE");
  145. }
  146. }
  147. }