using System; using Microsoft.EntityFrameworkCore.Migrations; namespace WCS.Service.Migrations { public partial class _931 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "WCS_PATHPOINT", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), STARTCODE = table.Column(type: "nvarchar(50)", nullable: true), ENDCODE = table.Column(type: "nvarchar(50)", nullable: true), DEVICECODE = table.Column(type: "nvarchar(50)", nullable: true), PREVCODE = table.Column(type: "nvarchar(50)", nullable: true), NEXTCODE = 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) }, constraints: table => { table.PrimaryKey("PK_WCS_PATHPOINT", x => x.ID); table.ForeignKey( name: "FK_WCS_PATHPOINT_WCS_DEVICE_DEVICECODE", column: x => x.DEVICECODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_WCS_PATHPOINT_WCS_DEVICE_ENDCODE", column: x => x.ENDCODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_WCS_PATHPOINT_WCS_DEVICE_NEXTCODE", column: x => x.NEXTCODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_WCS_PATHPOINT_WCS_DEVICE_PREVCODE", column: x => x.PREVCODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_WCS_PATHPOINT_WCS_DEVICE_STARTCODE", column: x => x.STARTCODE, principalTable: "WCS_DEVICE", principalColumn: "CODE", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_WCS_PATHPOINT_DEVICECODE", table: "WCS_PATHPOINT", column: "DEVICECODE"); migrationBuilder.CreateIndex( name: "IX_WCS_PATHPOINT_ENDCODE", table: "WCS_PATHPOINT", column: "ENDCODE"); migrationBuilder.CreateIndex( name: "IX_WCS_PATHPOINT_NEXTCODE", table: "WCS_PATHPOINT", column: "NEXTCODE"); migrationBuilder.CreateIndex( name: "IX_WCS_PATHPOINT_PREVCODE", table: "WCS_PATHPOINT", column: "PREVCODE"); migrationBuilder.CreateIndex( name: "IX_WCS_PATHPOINT_STARTCODE", table: "WCS_PATHPOINT", column: "STARTCODE"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WCS_PATHPOINT"); } } }