using System; using Microsoft.EntityFrameworkCore.Migrations; namespace WCS.Service.Migrations { public partial class 新增状态记录表 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "wCS_StatusLog", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), WCS_TASKID = table.Column(type: "int", nullable: true), NewStatus = table.Column(type: "int", nullable: false), OldStatus = table.Column(type: "int", nullable: false), upStatus = table.Column(type: "int", nullable: false), Node = table.Column(type: "nvarchar(max)", nullable: true), ENABLED = table.Column(type: "bit", nullable: false), UPDATEUSER = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), UPDATETIME = table.Column(type: "datetime2", nullable: false), VER = table.Column(type: "rowversion", rowVersion: true, nullable: true) }, constraints: table => { table.PrimaryKey("PK_wCS_StatusLog", x => x.ID); table.ForeignKey( name: "FK_wCS_StatusLog_WCS_TASK_WCS_TASKID", column: x => x.WCS_TASKID, principalTable: "WCS_TASK", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_wCS_StatusLog_WCS_TASKID", table: "wCS_StatusLog", column: "WCS_TASKID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "wCS_StatusLog"); } } }