20221024120645_202210242006.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace ProductionLineMonitor.Web.Migrations
  4. {
  5. public partial class _202210242006 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "Cims",
  11. columns: table => new
  12. {
  13. Id = table.Column<string>(type: "TEXT", nullable: false),
  14. Topic = table.Column<string>(type: "TEXT", nullable: true),
  15. Time = table.Column<DateTime>(type: "TEXT", nullable: false),
  16. IpAddress = table.Column<string>(type: "TEXT", nullable: true),
  17. User = table.Column<string>(type: "TEXT", nullable: true),
  18. PLCIsConnected = table.Column<bool>(type: "INTEGER", nullable: false),
  19. EAPIsConnected = table.Column<bool>(type: "INTEGER", nullable: false),
  20. CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
  21. UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true)
  22. },
  23. constraints: table =>
  24. {
  25. table.PrimaryKey("PK_Cims", x => x.Id);
  26. });
  27. migrationBuilder.CreateTable(
  28. name: "MachineStatistics",
  29. columns: table => new
  30. {
  31. Id = table.Column<string>(type: "TEXT", nullable: false),
  32. MachineId = table.Column<string>(type: "TEXT", nullable: true),
  33. Date = table.Column<DateTime>(type: "TEXT", nullable: false),
  34. ModuleType = table.Column<string>(type: "TEXT", nullable: true),
  35. TT = table.Column<int>(type: "INTEGER", nullable: true),
  36. Capacity = table.Column<int>(type: "INTEGER", nullable: true),
  37. Availability = table.Column<double>(type: "REAL", nullable: true),
  38. Performance = table.Column<double>(type: "REAL", nullable: true),
  39. Quality = table.Column<double>(type: "REAL", nullable: true),
  40. OEE = table.Column<double>(type: "REAL", nullable: true),
  41. CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
  42. UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true)
  43. },
  44. constraints: table =>
  45. {
  46. table.PrimaryKey("PK_MachineStatistics", x => x.Id);
  47. });
  48. }
  49. protected override void Down(MigrationBuilder migrationBuilder)
  50. {
  51. migrationBuilder.DropTable(
  52. name: "Cims");
  53. migrationBuilder.DropTable(
  54. name: "MachineStatistics");
  55. }
  56. }
  57. }