using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace WCS.Service.Migrations { public partial class _8 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.RenameColumn( name: "SCSTATION", table: "WCS_TASK", newName: "SRMSTATION"); migrationBuilder.CreateTable( name: "WCS_SRM520", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Handshake_1 = table.Column(type: "smallint", nullable: false), RES1_1 = table.Column(type: "smallint", nullable: false), RES2_1 = table.Column(type: "smallint", nullable: false), GoodsType_1 = table.Column(type: "smallint", nullable: false), SpeedMode_1 = table.Column(type: "smallint", nullable: false), SLine_1 = table.Column(type: "smallint", nullable: false), SCol_1 = table.Column(type: "smallint", nullable: false), SLayer_1 = table.Column(type: "smallint", nullable: false), SDepth_1 = table.Column(type: "smallint", nullable: false), ELine_1 = table.Column(type: "smallint", nullable: false), ECol_1 = table.Column(type: "smallint", nullable: false), ELayer_1 = table.Column(type: "smallint", nullable: false), EDepth_1 = table.Column(type: "smallint", nullable: false), TaskID_1 = table.Column(type: "int", nullable: false), VoucherNo_1 = table.Column(type: "smallint", nullable: false), FinishedACK_1 = table.Column(type: "smallint", nullable: false), RES3_1 = table.Column(type: "smallint", nullable: false), RES4_1 = table.Column(type: "smallint", nullable: false), Handshake_2 = table.Column(type: "smallint", nullable: false), RES1_2 = table.Column(type: "smallint", nullable: false), RES2_2 = table.Column(type: "smallint", nullable: false), GoodsType_2 = table.Column(type: "smallint", nullable: false), SCSpeedMode_2 = table.Column(type: "smallint", nullable: false), SLine_2 = table.Column(type: "smallint", nullable: false), SCol_2 = table.Column(type: "smallint", nullable: false), SLayer_2 = table.Column(type: "smallint", nullable: false), SDepth_2 = table.Column(type: "smallint", nullable: false), ELine_2 = table.Column(type: "smallint", nullable: false), ECol_2 = table.Column(type: "smallint", nullable: false), ELayer_2 = table.Column(type: "smallint", nullable: false), EDepth_2 = table.Column(type: "smallint", nullable: false), TaskID_2 = table.Column(type: "int", nullable: false), VoucherNo_2 = table.Column(type: "smallint", nullable: false), FinishedACK_2 = table.Column(type: "smallint", nullable: false), RES3_2 = table.Column(type: "smallint", nullable: false), RES4_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_SRM520", x => x.ID); table.ForeignKey( name: "FK_WCS_SRM520_WCS_DEVICE_DEVICECODE", column: x => x.DEVICECODE, principalTable: "WCS_DEVICE", principalColumn: "CODE"); }); migrationBuilder.CreateTable( name: "WCS_SRM521", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ForkStatus_1 = table.Column(type: "bigint", nullable: false), Mode_1 = table.Column(type: "smallint", nullable: false), Status_1 = table.Column(type: "smallint", nullable: false), SLine_1 = table.Column(type: "smallint", nullable: false), SCol_1 = table.Column(type: "smallint", nullable: false), SLayer_1 = table.Column(type: "smallint", nullable: false), SDepth_1 = table.Column(type: "smallint", nullable: false), ELine_1 = table.Column(type: "smallint", nullable: false), ECol_1 = table.Column(type: "smallint", nullable: false), ELayer_1 = table.Column(type: "smallint", nullable: false), EDepth_1 = table.Column(type: "smallint", nullable: false), TaskID_1 = table.Column(type: "int", nullable: false), VoucherNo_1 = table.Column(type: "smallint", nullable: false), Line_1 = table.Column(type: "smallint", nullable: false), Col_1 = table.Column(type: "smallint", nullable: false), Layer_1 = table.Column(type: "smallint", nullable: false), FinishedTask_1 = table.Column(type: "int", nullable: false), TravelPos_1 = table.Column(type: "int", nullable: false), LiftPos_1 = table.Column(type: "int", nullable: false), ForkPos_1 = table.Column(type: "int", nullable: false), RES9_1 = table.Column(type: "smallint", nullable: false), RES10_1 = table.Column(type: "smallint", nullable: false), TotalKM_1 = table.Column(type: "real", nullable: false), GoodsType_1 = table.Column(type: "smallint", nullable: false), Runtime_1 = table.Column(type: "real", nullable: false), RES11_1 = table.Column(type: "int", nullable: false), RES12_1 = table.Column(type: "int", nullable: false), RES13_1 = table.Column(type: "int", nullable: false), RES14_1 = table.Column(type: "int", nullable: false), ForkStatus_2 = table.Column(type: "bigint", nullable: false), Mode_2 = table.Column(type: "smallint", nullable: false), Status_2 = table.Column(type: "smallint", nullable: false), SLine_2 = table.Column(type: "smallint", nullable: false), SCol_2 = table.Column(type: "smallint", nullable: false), SLayer_2 = table.Column(type: "smallint", nullable: false), SDepth_2 = table.Column(type: "smallint", nullable: false), ELine_2 = table.Column(type: "smallint", nullable: false), ECol_2 = table.Column(type: "smallint", nullable: false), ELayer_2 = table.Column(type: "smallint", nullable: false), EDepth_2 = table.Column(type: "smallint", nullable: false), TaskID_2 = table.Column(type: "int", nullable: false), VoucherNo_2 = table.Column(type: "smallint", nullable: false), Line_2 = table.Column(type: "smallint", nullable: false), Col_2 = table.Column(type: "smallint", nullable: false), Layer_2 = table.Column(type: "smallint", nullable: false), FinishedTask_2 = table.Column(type: "int", nullable: false), TravelPos_2 = table.Column(type: "int", nullable: false), LiftPos_2 = table.Column(type: "int", nullable: false), ForkPos_2 = table.Column(type: "int", nullable: false), RES9_2 = table.Column(type: "smallint", nullable: false), RES10_2 = table.Column(type: "smallint", nullable: false), TotalKM_2 = table.Column(type: "real", nullable: false), GoodsType_2 = table.Column(type: "smallint", nullable: false), Runtime_2 = table.Column(type: "real", nullable: false), RES11_2 = table.Column(type: "int", nullable: false), RES12_2 = table.Column(type: "int", nullable: false), RES13_2 = table.Column(type: "int", nullable: false), RES14_2 = table.Column(type: "int", nullable: false), SRMMode = table.Column(type: "smallint", nullable: false), SRMStatus = table.Column(type: "smallint", nullable: false), TotalKM = table.Column(type: "real", nullable: false), Runtime = table.Column(type: "real", nullable: false), Alarm = 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_SRM521", x => x.ID); table.ForeignKey( name: "FK_WCS_SRM521_WCS_DEVICE_DEVICECODE", column: x => x.DEVICECODE, principalTable: "WCS_DEVICE", principalColumn: "CODE"); }); migrationBuilder.CreateTable( name: "WCS_SRM537", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SCAlarm = table.Column(type: "decimal(20,0)", 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_SRM537", x => x.ID); table.ForeignKey( name: "FK_WCS_SRM537_WCS_DEVICE_DEVICECODE", column: x => x.DEVICECODE, principalTable: "WCS_DEVICE", principalColumn: "CODE"); }); migrationBuilder.CreateIndex( name: "IX_WCS_SRM520_DEVICECODE", table: "WCS_SRM520", column: "DEVICECODE"); migrationBuilder.CreateIndex( name: "IX_WCS_SRM521_DEVICECODE", table: "WCS_SRM521", column: "DEVICECODE"); migrationBuilder.CreateIndex( name: "IX_WCS_SRM537_DEVICECODE", table: "WCS_SRM537", column: "DEVICECODE"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WCS_SRM520"); migrationBuilder.DropTable( name: "WCS_SRM521"); migrationBuilder.DropTable( name: "WCS_SRM537"); migrationBuilder.RenameColumn( name: "SRMSTATION", table: "WCS_TASK", newName: "SCSTATION"); } } }