20220304021131_新增状态记录表.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace WCS.Service.Migrations
  4. {
  5. public partial class 新增状态记录表 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "wCS_StatusLog",
  11. columns: table => new
  12. {
  13. ID = table.Column<int>(type: "int", nullable: false)
  14. .Annotation("SqlServer:Identity", "1, 1"),
  15. WCS_TASKID = table.Column<int>(type: "int", nullable: true),
  16. NewStatus = table.Column<int>(type: "int", nullable: false),
  17. OldStatus = table.Column<int>(type: "int", nullable: false),
  18. upStatus = table.Column<int>(type: "int", nullable: false),
  19. Node = table.Column<string>(type: "nvarchar(max)", nullable: true),
  20. ENABLED = table.Column<bool>(type: "bit", nullable: false),
  21. UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  22. UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
  23. VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true)
  24. },
  25. constraints: table =>
  26. {
  27. table.PrimaryKey("PK_wCS_StatusLog", x => x.ID);
  28. table.ForeignKey(
  29. name: "FK_wCS_StatusLog_WCS_TASK_WCS_TASKID",
  30. column: x => x.WCS_TASKID,
  31. principalTable: "WCS_TASK",
  32. principalColumn: "ID",
  33. onDelete: ReferentialAction.Restrict);
  34. });
  35. migrationBuilder.CreateIndex(
  36. name: "IX_wCS_StatusLog_WCS_TASKID",
  37. table: "wCS_StatusLog",
  38. column: "WCS_TASKID");
  39. }
  40. protected override void Down(MigrationBuilder migrationBuilder)
  41. {
  42. migrationBuilder.DropTable(
  43. name: "wCS_StatusLog");
  44. }
  45. }
  46. }