using System; using Microsoft.EntityFrameworkCore.Migrations; namespace WCS.Service.Migrations { public partial class 双工位RGV : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "WCS_DRGV520", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), TaskID_1 = table.Column(type: "int", nullable: false), TaskType_1 = table.Column(type: "smallint", nullable: false), StartPosition_1 = table.Column(type: "smallint", nullable: false), DestPosition_1 = table.Column(type: "smallint", nullable: false), PRIORITY_1 = table.Column(type: "smallint", nullable: false), RES1_1 = table.Column(type: "smallint", nullable: false), res2_1 = table.Column(type: "smallint", nullable: false), Trigger_1 = table.Column(type: "smallint", nullable: false), TaskID_2 = table.Column(type: "int", nullable: false), TaskType_2 = table.Column(type: "smallint", nullable: false), StartPosition_2 = table.Column(type: "smallint", nullable: false), DestPosition_2 = table.Column(type: "smallint", nullable: false), PRIORITY_2 = table.Column(type: "smallint", nullable: false), RES1_2 = table.Column(type: "smallint", nullable: false), res2_2 = table.Column(type: "smallint", nullable: false), Trigger_2 = table.Column(type: "smallint", nullable: false), 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), DEVICECODE = table.Column(type: "nvarchar(50)", nullable: true), FRAME = table.Column(type: "datetime2", nullable: false), ISLAST = table.Column(type: "bit", nullable: false), WCSVERSION = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_WCS_DRGV520", x => x.ID); table.ForeignKey( name: "FK_WCS_DRGV520_WCS_DEVICE_DEVICECODE", column: x => x.DEVICECODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "WCS_DRGV521", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), TaskID_1 = table.Column(type: "int", nullable: false), TaskType_1 = table.Column(type: "smallint", nullable: false), StartPosition_1 = table.Column(type: "smallint", nullable: false), DestPosition_1 = table.Column(type: "smallint", nullable: false), PRIORITY_1 = table.Column(type: "smallint", nullable: false), ACT_V_1 = table.Column(type: "smallint", nullable: false), RES2_1 = table.Column(type: "smallint", nullable: false), PH_Status_1 = table.Column(type: "bit", nullable: false), ToSition_1 = table.Column(type: "bit", nullable: false), Finish_1 = table.Column(type: "bit", nullable: false), TaskID_2 = table.Column(type: "int", nullable: false), TaskType_2 = table.Column(type: "smallint", nullable: false), StartPosition_2 = table.Column(type: "smallint", nullable: false), DestPosition_2 = table.Column(type: "smallint", nullable: false), PRIORITY_2 = table.Column(type: "smallint", nullable: false), ACT_V_2 = table.Column(type: "smallint", nullable: false), RES2_2 = table.Column(type: "smallint", nullable: false), PH_Status_2 = table.Column(type: "bit", nullable: false), ToSition_2 = table.Column(type: "bit", nullable: false), Finish_2 = table.Column(type: "bit", nullable: false), SystemStatus = table.Column(type: "smallint", nullable: false), WorkMode = table.Column(type: "smallint", nullable: false), RES = table.Column(type: "smallint", nullable: false), Position = table.Column(type: "real", nullable: false), Mileage = table.Column(type: "real", nullable: false), Runtime = table.Column(type: "real", nullable: false), 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), DEVICECODE = table.Column(type: "nvarchar(50)", nullable: true), FRAME = table.Column(type: "datetime2", nullable: false), ISLAST = table.Column(type: "bit", nullable: false), WCSVERSION = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_WCS_DRGV521", x => x.ID); table.ForeignKey( name: "FK_WCS_DRGV521_WCS_DEVICE_DEVICECODE", column: x => x.DEVICECODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "WCS_DRGV523", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Fault = table.Column(type: "int", nullable: false), Fault1 = table.Column(type: "int", nullable: false), Fault2 = table.Column(type: "int", nullable: false), Status = table.Column(type: "int", nullable: false), Status1 = table.Column(type: "int", nullable: false), Status2 = table.Column(type: "int", nullable: false), DEVICECODE = table.Column(type: "nvarchar(50)", 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), FRAME = table.Column(type: "datetime2", nullable: false), ISLAST = table.Column(type: "bit", nullable: false), WCSVERSION = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_WCS_DRGV523", x => x.ID); table.ForeignKey( name: "FK_WCS_DRGV523_WCS_DEVICE_DEVICECODE", column: x => x.DEVICECODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_WCS_DRGV520_DEVICECODE", table: "WCS_DRGV520", column: "DEVICECODE"); migrationBuilder.CreateIndex( name: "IX_WCS_DRGV521_DEVICECODE", table: "WCS_DRGV521", column: "DEVICECODE"); migrationBuilder.CreateIndex( name: "IX_WCS_DRGV523_DEVICECODE", table: "WCS_DRGV523", column: "DEVICECODE"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WCS_DRGV520"); migrationBuilder.DropTable( name: "WCS_DRGV521"); migrationBuilder.DropTable( name: "WCS_DRGV523"); } } }