using System; using Microsoft.EntityFrameworkCore.Migrations; namespace WCS.Service.Migrations { public partial class _7203 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "DEVICECODE", table: "WCS_RobotStation", type: "nvarchar(50)", nullable: true); migrationBuilder.AddColumn( name: "FRAME", table: "WCS_RobotStation", type: "datetime2", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddColumn( name: "ISLAST", table: "WCS_RobotStation", type: "bit", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "WCSVERSION", table: "WCS_RobotStation", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "DEVICECODE", table: "WCS_Robot", type: "nvarchar(50)", nullable: true); migrationBuilder.AddColumn( name: "FRAME", table: "WCS_Robot", type: "datetime2", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddColumn( name: "ISLAST", table: "WCS_Robot", type: "bit", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "WCSVERSION", table: "WCS_Robot", type: "int", nullable: false, defaultValue: 0); migrationBuilder.CreateIndex( name: "IX_WCS_RobotStation_DEVICECODE", table: "WCS_RobotStation", column: "DEVICECODE"); migrationBuilder.CreateIndex( name: "IX_WCS_Robot_DEVICECODE", table: "WCS_Robot", column: "DEVICECODE"); migrationBuilder.AddForeignKey( name: "FK_WCS_Robot_WCS_DEVICE_DEVICECODE", table: "WCS_Robot", column: "DEVICECODE", principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_WCS_RobotStation_WCS_DEVICE_DEVICECODE", table: "WCS_RobotStation", column: "DEVICECODE", principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_WCS_Robot_WCS_DEVICE_DEVICECODE", table: "WCS_Robot"); migrationBuilder.DropForeignKey( name: "FK_WCS_RobotStation_WCS_DEVICE_DEVICECODE", table: "WCS_RobotStation"); migrationBuilder.DropIndex( name: "IX_WCS_RobotStation_DEVICECODE", table: "WCS_RobotStation"); migrationBuilder.DropIndex( name: "IX_WCS_Robot_DEVICECODE", table: "WCS_Robot"); migrationBuilder.DropColumn( name: "DEVICECODE", table: "WCS_RobotStation"); migrationBuilder.DropColumn( name: "FRAME", table: "WCS_RobotStation"); migrationBuilder.DropColumn( name: "ISLAST", table: "WCS_RobotStation"); migrationBuilder.DropColumn( name: "WCSVERSION", table: "WCS_RobotStation"); migrationBuilder.DropColumn( name: "DEVICECODE", table: "WCS_Robot"); migrationBuilder.DropColumn( name: "FRAME", table: "WCS_Robot"); migrationBuilder.DropColumn( name: "ISLAST", table: "WCS_Robot"); migrationBuilder.DropColumn( name: "WCSVERSION", table: "WCS_Robot"); } } }