20241014060752_2024-10-14-1.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace Repository.Migrations
  4. {
  5. public partial class _202410141 : 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: "Houses",
  23. columns: table => new
  24. {
  25. Id = table.Column<Guid>(nullable: false),
  26. DateH = table.Column<string>(nullable: true),
  27. LackH = table.Column<string>(nullable: true),
  28. UsedH = table.Column<string>(nullable: true),
  29. TotalH = table.Column<string>(nullable: true)
  30. },
  31. constraints: table =>
  32. {
  33. table.PrimaryKey("PK_Houses", x => x.Id);
  34. });
  35. migrationBuilder.CreateTable(
  36. name: "Informations",
  37. columns: table => new
  38. {
  39. Id = table.Column<Guid>(nullable: false),
  40. OperatorCode = table.Column<string>(nullable: true),
  41. ProCode = table.Column<string>(nullable: true),
  42. SpendTime = table.Column<double>(nullable: false),
  43. CreateTime = table.Column<DateTime>(nullable: false),
  44. ProType = table.Column<string>(nullable: true),
  45. ProNo = table.Column<string>(nullable: true)
  46. },
  47. constraints: table =>
  48. {
  49. table.PrimaryKey("PK_Informations", x => x.Id);
  50. });
  51. migrationBuilder.CreateTable(
  52. name: "OutofWorks",
  53. columns: table => new
  54. {
  55. Id = table.Column<Guid>(nullable: false),
  56. DateOutWork = table.Column<string>(nullable: true),
  57. Actual = table.Column<int>(nullable: false),
  58. FallIll = table.Column<int>(nullable: false),
  59. Absenteeism = table.Column<int>(nullable: false)
  60. },
  61. constraints: table =>
  62. {
  63. table.PrimaryKey("PK_OutofWorks", x => x.Id);
  64. });
  65. migrationBuilder.CreateTable(
  66. name: "ParamLogs",
  67. columns: table => new
  68. {
  69. Id = table.Column<Guid>(nullable: false),
  70. Occured = table.Column<DateTime>(nullable: false),
  71. Content = table.Column<string>(nullable: true),
  72. OperateAction = table.Column<int>(nullable: false),
  73. OperateObject = table.Column<string>(nullable: true),
  74. UserName = table.Column<string>(nullable: true)
  75. },
  76. constraints: table =>
  77. {
  78. table.PrimaryKey("PK_ParamLogs", x => x.Id);
  79. });
  80. migrationBuilder.CreateTable(
  81. name: "Persons",
  82. columns: table => new
  83. {
  84. Id = table.Column<Guid>(nullable: false),
  85. EmployeeName = table.Column<string>(nullable: true),
  86. ProProcess = table.Column<string>(nullable: true),
  87. WorkTime = table.Column<string>(nullable: true),
  88. Yield = table.Column<int>(nullable: false)
  89. },
  90. constraints: table =>
  91. {
  92. table.PrimaryKey("PK_Persons", x => x.Id);
  93. });
  94. migrationBuilder.CreateTable(
  95. name: "ProductResult",
  96. columns: table => new
  97. {
  98. Id = table.Column<Guid>(nullable: false),
  99. Result = table.Column<double>(nullable: false),
  100. Datetime = table.Column<DateTime>(nullable: false),
  101. Barcode = table.Column<string>(nullable: true),
  102. Juge = table.Column<int>(nullable: false)
  103. },
  104. constraints: table =>
  105. {
  106. table.PrimaryKey("PK_ProductResult", x => x.Id);
  107. });
  108. migrationBuilder.CreateTable(
  109. name: "Qualitys",
  110. columns: table => new
  111. {
  112. Id = table.Column<Guid>(nullable: false),
  113. DateQuality = table.Column<string>(nullable: true),
  114. Q1 = table.Column<int>(nullable: false),
  115. Q2 = table.Column<int>(nullable: false),
  116. Q3 = table.Column<int>(nullable: false),
  117. Q4 = table.Column<int>(nullable: false),
  118. Q5 = table.Column<int>(nullable: false),
  119. Q6 = table.Column<int>(nullable: false),
  120. Q7 = table.Column<int>(nullable: false),
  121. Q8 = table.Column<int>(nullable: false),
  122. Q9 = table.Column<int>(nullable: false),
  123. Q10 = table.Column<int>(nullable: false),
  124. Q11 = table.Column<int>(nullable: false),
  125. Q12 = table.Column<int>(nullable: false),
  126. Q13 = table.Column<int>(nullable: false),
  127. Q14 = table.Column<int>(nullable: false),
  128. Q15 = table.Column<int>(nullable: false),
  129. Q16 = table.Column<int>(nullable: false),
  130. Q17 = table.Column<int>(nullable: false),
  131. Q18 = table.Column<int>(nullable: false),
  132. Q19 = table.Column<int>(nullable: false),
  133. Q20 = table.Column<int>(nullable: false),
  134. Q21 = table.Column<int>(nullable: false),
  135. Q22 = table.Column<int>(nullable: false),
  136. Q23 = table.Column<int>(nullable: false),
  137. Q24 = table.Column<int>(nullable: false),
  138. Q25 = table.Column<int>(nullable: false),
  139. Q26 = table.Column<int>(nullable: false),
  140. Q27 = table.Column<int>(nullable: false),
  141. Q28 = table.Column<int>(nullable: false),
  142. Q29 = table.Column<int>(nullable: false),
  143. Q30 = table.Column<int>(nullable: false)
  144. },
  145. constraints: table =>
  146. {
  147. table.PrimaryKey("PK_Qualitys", x => x.Id);
  148. });
  149. migrationBuilder.CreateTable(
  150. name: "SopFiles",
  151. columns: table => new
  152. {
  153. ID = table.Column<Guid>(nullable: false),
  154. ProductName = table.Column<string>(nullable: true)
  155. },
  156. constraints: table =>
  157. {
  158. table.PrimaryKey("PK_SopFiles", x => x.ID);
  159. });
  160. migrationBuilder.CreateTable(
  161. name: "StatisticsLogs",
  162. columns: table => new
  163. {
  164. Id = table.Column<Guid>(nullable: false),
  165. Timestamp = table.Column<DateTime>(nullable: false),
  166. TraceState = table.Column<int>(nullable: false),
  167. RequstType = table.Column<int>(nullable: false),
  168. RequestCode = table.Column<int>(nullable: false)
  169. },
  170. constraints: table =>
  171. {
  172. table.PrimaryKey("PK_StatisticsLogs", x => x.Id);
  173. });
  174. migrationBuilder.CreateTable(
  175. name: "LocalFile",
  176. columns: table => new
  177. {
  178. Id = table.Column<Guid>(nullable: false),
  179. FileNum = table.Column<string>(nullable: true),
  180. Edition = table.Column<string>(nullable: true),
  181. Date = table.Column<string>(nullable: true),
  182. Type = table.Column<string>(nullable: true),
  183. People = table.Column<string>(nullable: true),
  184. Name = table.Column<string>(nullable: true),
  185. Process = table.Column<string>(nullable: true),
  186. WorkTime = table.Column<string>(nullable: true),
  187. SopFileID = table.Column<Guid>(nullable: true)
  188. },
  189. constraints: table =>
  190. {
  191. table.PrimaryKey("PK_LocalFile", x => x.Id);
  192. table.ForeignKey(
  193. name: "FK_LocalFile_SopFiles_SopFileID",
  194. column: x => x.SopFileID,
  195. principalTable: "SopFiles",
  196. principalColumn: "ID",
  197. onDelete: ReferentialAction.Restrict);
  198. });
  199. migrationBuilder.CreateTable(
  200. name: "LocalFile2",
  201. columns: table => new
  202. {
  203. Id = table.Column<Guid>(nullable: false),
  204. Num = table.Column<string>(nullable: true),
  205. MaterialNum = table.Column<string>(nullable: true),
  206. MaterialName = table.Column<string>(nullable: true),
  207. Count = table.Column<string>(nullable: true),
  208. Unit = table.Column<string>(nullable: true),
  209. SopFileID = table.Column<Guid>(nullable: true)
  210. },
  211. constraints: table =>
  212. {
  213. table.PrimaryKey("PK_LocalFile2", x => x.Id);
  214. table.ForeignKey(
  215. name: "FK_LocalFile2_SopFiles_SopFileID",
  216. column: x => x.SopFileID,
  217. principalTable: "SopFiles",
  218. principalColumn: "ID",
  219. onDelete: ReferentialAction.Restrict);
  220. });
  221. migrationBuilder.CreateTable(
  222. name: "LocalFile3",
  223. columns: table => new
  224. {
  225. Id = table.Column<Guid>(nullable: false),
  226. Equipment = table.Column<string>(nullable: true),
  227. Before = table.Column<string>(nullable: true),
  228. Inn = table.Column<string>(nullable: true),
  229. After = table.Column<string>(nullable: true),
  230. LookOut = table.Column<string>(nullable: true),
  231. SopFileID = table.Column<Guid>(nullable: true)
  232. },
  233. constraints: table =>
  234. {
  235. table.PrimaryKey("PK_LocalFile3", x => x.Id);
  236. table.ForeignKey(
  237. name: "FK_LocalFile3_SopFiles_SopFileID",
  238. column: x => x.SopFileID,
  239. principalTable: "SopFiles",
  240. principalColumn: "ID",
  241. onDelete: ReferentialAction.Restrict);
  242. });
  243. migrationBuilder.CreateIndex(
  244. name: "IX_LocalFile_SopFileID",
  245. table: "LocalFile",
  246. column: "SopFileID");
  247. migrationBuilder.CreateIndex(
  248. name: "IX_LocalFile2_SopFileID",
  249. table: "LocalFile2",
  250. column: "SopFileID");
  251. migrationBuilder.CreateIndex(
  252. name: "IX_LocalFile3_SopFileID",
  253. table: "LocalFile3",
  254. column: "SopFileID");
  255. }
  256. protected override void Down(MigrationBuilder migrationBuilder)
  257. {
  258. migrationBuilder.DropTable(
  259. name: "Accounts");
  260. migrationBuilder.DropTable(
  261. name: "Houses");
  262. migrationBuilder.DropTable(
  263. name: "Informations");
  264. migrationBuilder.DropTable(
  265. name: "LocalFile");
  266. migrationBuilder.DropTable(
  267. name: "LocalFile2");
  268. migrationBuilder.DropTable(
  269. name: "LocalFile3");
  270. migrationBuilder.DropTable(
  271. name: "OutofWorks");
  272. migrationBuilder.DropTable(
  273. name: "ParamLogs");
  274. migrationBuilder.DropTable(
  275. name: "Persons");
  276. migrationBuilder.DropTable(
  277. name: "ProductResult");
  278. migrationBuilder.DropTable(
  279. name: "Qualitys");
  280. migrationBuilder.DropTable(
  281. name: "StatisticsLogs");
  282. migrationBuilder.DropTable(
  283. name: "SopFiles");
  284. }
  285. }
  286. }