20210724114949_7-24-1.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace WCS.Service.Migrations
  4. {
  5. public partial class _7241 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.AlterColumn<string>(
  10. name: "TUNNEL",
  11. table: "WCS_TASK",
  12. type: "nvarchar(10)",
  13. maxLength: 10,
  14. nullable: true,
  15. oldClrType: typeof(int),
  16. oldType: "int");
  17. migrationBuilder.CreateTable(
  18. name: "WCS_AGVTask",
  19. columns: table => new
  20. {
  21. ID = table.Column<int>(type: "int", nullable: false)
  22. .Annotation("SqlServer:Identity", "1, 1"),
  23. TaskType = table.Column<int>(type: "int", nullable: false),
  24. Status = table.Column<int>(type: "int", nullable: false),
  25. AGVStatus = table.Column<int>(type: "int", nullable: false),
  26. Workshop = table.Column<int>(type: "int", nullable: false),
  27. Station = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
  28. Position = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  29. CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
  30. UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
  31. AGVUpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true)
  32. },
  33. constraints: table =>
  34. {
  35. table.PrimaryKey("PK_WCS_AGVTask", x => x.ID);
  36. });
  37. }
  38. protected override void Down(MigrationBuilder migrationBuilder)
  39. {
  40. migrationBuilder.DropTable(
  41. name: "WCS_AGVTask");
  42. migrationBuilder.AlterColumn<int>(
  43. name: "TUNNEL",
  44. table: "WCS_TASK",
  45. type: "int",
  46. nullable: false,
  47. defaultValue: 0,
  48. oldClrType: typeof(string),
  49. oldType: "nvarchar(10)",
  50. oldMaxLength: 10,
  51. oldNullable: true);
  52. }
  53. }
  54. }