20241019092706_20241019.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace Repository.Migrations
  4. {
  5. public partial class _20241019 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "Accounts",
  11. columns: table => new
  12. {
  13. Id = table.Column<Guid>(nullable: false),
  14. AccountID = table.Column<string>(nullable: true),
  15. ChangePassword = table.Column<string>(nullable: true)
  16. },
  17. constraints: table =>
  18. {
  19. table.PrimaryKey("PK_Accounts", x => x.Id);
  20. });
  21. migrationBuilder.CreateTable(
  22. name: "AllNumbers",
  23. columns: table => new
  24. {
  25. Id = table.Column<Guid>(nullable: false),
  26. DateA = table.Column<DateTime>(nullable: false),
  27. PlanA = table.Column<double>(nullable: false),
  28. RealityA = table.Column<double>(nullable: false),
  29. OkA = table.Column<double>(nullable: false),
  30. NgA = table.Column<double>(nullable: false),
  31. ErrA = table.Column<double>(nullable: false)
  32. },
  33. constraints: table =>
  34. {
  35. table.PrimaryKey("PK_AllNumbers", x => x.Id);
  36. });
  37. migrationBuilder.CreateTable(
  38. name: "DeviceStatus",
  39. columns: table => new
  40. {
  41. Id = table.Column<Guid>(nullable: false),
  42. DateDS = table.Column<DateTime>(nullable: false),
  43. AlarmTime = table.Column<double>(nullable: false)
  44. },
  45. constraints: table =>
  46. {
  47. table.PrimaryKey("PK_DeviceStatus", x => x.Id);
  48. });
  49. migrationBuilder.CreateTable(
  50. name: "Houses",
  51. columns: table => new
  52. {
  53. Id = table.Column<Guid>(nullable: false),
  54. DateH = table.Column<DateTime>(nullable: false),
  55. LackH = table.Column<string>(nullable: true),
  56. UsedH = table.Column<string>(nullable: true),
  57. TotalH = table.Column<string>(nullable: true)
  58. },
  59. constraints: table =>
  60. {
  61. table.PrimaryKey("PK_Houses", x => x.Id);
  62. });
  63. migrationBuilder.CreateTable(
  64. name: "Informations",
  65. columns: table => new
  66. {
  67. Id = table.Column<Guid>(nullable: false),
  68. CreateTime = table.Column<DateTime>(nullable: false),
  69. OperatorCode = table.Column<string>(nullable: true),
  70. ProCode = table.Column<string>(nullable: true),
  71. SpendTime = table.Column<double>(nullable: false),
  72. ProType = table.Column<string>(nullable: true),
  73. ProNo = table.Column<string>(nullable: true),
  74. ItemCode = table.Column<string>(nullable: true),
  75. OrderNo = table.Column<string>(nullable: true),
  76. TestResult = table.Column<string>(nullable: true)
  77. },
  78. constraints: table =>
  79. {
  80. table.PrimaryKey("PK_Informations", x => x.Id);
  81. });
  82. migrationBuilder.CreateTable(
  83. name: "OutofWorks",
  84. columns: table => new
  85. {
  86. Id = table.Column<Guid>(nullable: false),
  87. DateOutWork = table.Column<DateTime>(nullable: false),
  88. Actual = table.Column<int>(nullable: false),
  89. FallIll = table.Column<int>(nullable: false),
  90. Absenteeism = table.Column<int>(nullable: false)
  91. },
  92. constraints: table =>
  93. {
  94. table.PrimaryKey("PK_OutofWorks", x => x.Id);
  95. });
  96. migrationBuilder.CreateTable(
  97. name: "ParamLogs",
  98. columns: table => new
  99. {
  100. Id = table.Column<Guid>(nullable: false),
  101. Occured = table.Column<DateTime>(nullable: false),
  102. Content = table.Column<string>(nullable: true),
  103. OperateAction = table.Column<int>(nullable: false),
  104. OperateObject = table.Column<string>(nullable: true),
  105. UserName = table.Column<string>(nullable: true)
  106. },
  107. constraints: table =>
  108. {
  109. table.PrimaryKey("PK_ParamLogs", x => x.Id);
  110. });
  111. migrationBuilder.CreateTable(
  112. name: "Persons",
  113. columns: table => new
  114. {
  115. Id = table.Column<Guid>(nullable: false),
  116. EmployeeName = table.Column<string>(nullable: true),
  117. ProProcess = table.Column<string>(nullable: true),
  118. WorkTime = table.Column<string>(nullable: true),
  119. Yield = table.Column<int>(nullable: false)
  120. },
  121. constraints: table =>
  122. {
  123. table.PrimaryKey("PK_Persons", x => x.Id);
  124. });
  125. migrationBuilder.CreateTable(
  126. name: "ProductResult",
  127. columns: table => new
  128. {
  129. Id = table.Column<Guid>(nullable: false),
  130. Result = table.Column<double>(nullable: false),
  131. Datetime = table.Column<DateTime>(nullable: false),
  132. Barcode = table.Column<string>(nullable: true),
  133. Juge = table.Column<int>(nullable: false)
  134. },
  135. constraints: table =>
  136. {
  137. table.PrimaryKey("PK_ProductResult", x => x.Id);
  138. });
  139. migrationBuilder.CreateTable(
  140. name: "ProStatus",
  141. columns: table => new
  142. {
  143. Id = table.Column<Guid>(nullable: false),
  144. DateS = table.Column<DateTime>(nullable: false),
  145. OrdNoS = table.Column<string>(nullable: true),
  146. PlanS = table.Column<double>(nullable: false),
  147. RealityS = table.Column<int>(nullable: false),
  148. OkS = table.Column<int>(nullable: false),
  149. NgS = table.Column<int>(nullable: false),
  150. ErrS = table.Column<int>(nullable: false)
  151. },
  152. constraints: table =>
  153. {
  154. table.PrimaryKey("PK_ProStatus", x => x.Id);
  155. });
  156. migrationBuilder.CreateTable(
  157. name: "Qualitys",
  158. columns: table => new
  159. {
  160. Id = table.Column<Guid>(nullable: false),
  161. DateQuality = table.Column<DateTime>(nullable: false),
  162. QuPCode = table.Column<string>(nullable: true),
  163. Q1 = table.Column<int>(nullable: false),
  164. Q2 = table.Column<int>(nullable: false),
  165. Q3 = table.Column<int>(nullable: false),
  166. Q4 = table.Column<int>(nullable: false),
  167. Q5 = table.Column<int>(nullable: false),
  168. Q6 = table.Column<int>(nullable: false),
  169. Q7 = table.Column<int>(nullable: false),
  170. Q8 = table.Column<int>(nullable: false),
  171. Q9 = table.Column<int>(nullable: false),
  172. Q10 = table.Column<int>(nullable: false),
  173. Q11 = table.Column<int>(nullable: false),
  174. Q12 = table.Column<int>(nullable: false),
  175. Q13 = table.Column<int>(nullable: false),
  176. Q14 = table.Column<int>(nullable: false),
  177. Q15 = table.Column<int>(nullable: false),
  178. Q16 = table.Column<int>(nullable: false),
  179. Q17 = table.Column<int>(nullable: false),
  180. Q18 = table.Column<int>(nullable: false),
  181. Q19 = table.Column<int>(nullable: false),
  182. Q20 = table.Column<int>(nullable: false),
  183. Q21 = table.Column<int>(nullable: false),
  184. Q22 = table.Column<int>(nullable: false),
  185. Q23 = table.Column<int>(nullable: false),
  186. Q24 = table.Column<int>(nullable: false),
  187. Q25 = table.Column<int>(nullable: false),
  188. Q26 = table.Column<int>(nullable: false),
  189. Q27 = table.Column<int>(nullable: false),
  190. Q28 = table.Column<int>(nullable: false),
  191. Q29 = table.Column<int>(nullable: false),
  192. Q30 = table.Column<int>(nullable: false)
  193. },
  194. constraints: table =>
  195. {
  196. table.PrimaryKey("PK_Qualitys", x => x.Id);
  197. });
  198. migrationBuilder.CreateTable(
  199. name: "SopFiles",
  200. columns: table => new
  201. {
  202. ID = table.Column<Guid>(nullable: false),
  203. ProductName = table.Column<string>(nullable: true)
  204. },
  205. constraints: table =>
  206. {
  207. table.PrimaryKey("PK_SopFiles", x => x.ID);
  208. });
  209. migrationBuilder.CreateTable(
  210. name: "StatisticsLogs",
  211. columns: table => new
  212. {
  213. Id = table.Column<Guid>(nullable: false),
  214. Timestamp = table.Column<DateTime>(nullable: false),
  215. TraceState = table.Column<int>(nullable: false),
  216. RequstType = table.Column<int>(nullable: false),
  217. RequestCode = table.Column<int>(nullable: false)
  218. },
  219. constraints: table =>
  220. {
  221. table.PrimaryKey("PK_StatisticsLogs", x => x.Id);
  222. });
  223. migrationBuilder.CreateTable(
  224. name: "LocalFile",
  225. columns: table => new
  226. {
  227. Id = table.Column<Guid>(nullable: false),
  228. FileNum = table.Column<string>(nullable: true),
  229. Edition = table.Column<string>(nullable: true),
  230. Date = table.Column<string>(nullable: true),
  231. Type = table.Column<string>(nullable: true),
  232. People = table.Column<string>(nullable: true),
  233. Name = table.Column<string>(nullable: true),
  234. Process = table.Column<string>(nullable: true),
  235. WorkTime = table.Column<string>(nullable: true),
  236. SopFileID = table.Column<Guid>(nullable: true)
  237. },
  238. constraints: table =>
  239. {
  240. table.PrimaryKey("PK_LocalFile", x => x.Id);
  241. table.ForeignKey(
  242. name: "FK_LocalFile_SopFiles_SopFileID",
  243. column: x => x.SopFileID,
  244. principalTable: "SopFiles",
  245. principalColumn: "ID",
  246. onDelete: ReferentialAction.Restrict);
  247. });
  248. migrationBuilder.CreateTable(
  249. name: "LocalFile2",
  250. columns: table => new
  251. {
  252. Id = table.Column<Guid>(nullable: false),
  253. Num = table.Column<string>(nullable: true),
  254. MaterialNum = table.Column<string>(nullable: true),
  255. MaterialName = table.Column<string>(nullable: true),
  256. Count = table.Column<string>(nullable: true),
  257. Unit = table.Column<string>(nullable: true),
  258. SopFileID = table.Column<Guid>(nullable: true)
  259. },
  260. constraints: table =>
  261. {
  262. table.PrimaryKey("PK_LocalFile2", x => x.Id);
  263. table.ForeignKey(
  264. name: "FK_LocalFile2_SopFiles_SopFileID",
  265. column: x => x.SopFileID,
  266. principalTable: "SopFiles",
  267. principalColumn: "ID",
  268. onDelete: ReferentialAction.Restrict);
  269. });
  270. migrationBuilder.CreateTable(
  271. name: "LocalFile3",
  272. columns: table => new
  273. {
  274. Id = table.Column<Guid>(nullable: false),
  275. Equipment = table.Column<string>(nullable: true),
  276. Before = table.Column<string>(nullable: true),
  277. Inn = table.Column<string>(nullable: true),
  278. After = table.Column<string>(nullable: true),
  279. LookOut = table.Column<string>(nullable: true),
  280. SopFileID = table.Column<Guid>(nullable: true)
  281. },
  282. constraints: table =>
  283. {
  284. table.PrimaryKey("PK_LocalFile3", x => x.Id);
  285. table.ForeignKey(
  286. name: "FK_LocalFile3_SopFiles_SopFileID",
  287. column: x => x.SopFileID,
  288. principalTable: "SopFiles",
  289. principalColumn: "ID",
  290. onDelete: ReferentialAction.Restrict);
  291. });
  292. migrationBuilder.CreateIndex(
  293. name: "IX_LocalFile_SopFileID",
  294. table: "LocalFile",
  295. column: "SopFileID");
  296. migrationBuilder.CreateIndex(
  297. name: "IX_LocalFile2_SopFileID",
  298. table: "LocalFile2",
  299. column: "SopFileID");
  300. migrationBuilder.CreateIndex(
  301. name: "IX_LocalFile3_SopFileID",
  302. table: "LocalFile3",
  303. column: "SopFileID");
  304. }
  305. protected override void Down(MigrationBuilder migrationBuilder)
  306. {
  307. migrationBuilder.DropTable(
  308. name: "Accounts");
  309. migrationBuilder.DropTable(
  310. name: "AllNumbers");
  311. migrationBuilder.DropTable(
  312. name: "DeviceStatus");
  313. migrationBuilder.DropTable(
  314. name: "Houses");
  315. migrationBuilder.DropTable(
  316. name: "Informations");
  317. migrationBuilder.DropTable(
  318. name: "LocalFile");
  319. migrationBuilder.DropTable(
  320. name: "LocalFile2");
  321. migrationBuilder.DropTable(
  322. name: "LocalFile3");
  323. migrationBuilder.DropTable(
  324. name: "OutofWorks");
  325. migrationBuilder.DropTable(
  326. name: "ParamLogs");
  327. migrationBuilder.DropTable(
  328. name: "Persons");
  329. migrationBuilder.DropTable(
  330. name: "ProductResult");
  331. migrationBuilder.DropTable(
  332. name: "ProStatus");
  333. migrationBuilder.DropTable(
  334. name: "Qualitys");
  335. migrationBuilder.DropTable(
  336. name: "StatisticsLogs");
  337. migrationBuilder.DropTable(
  338. name: "SopFiles");
  339. }
  340. }
  341. }