using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class AddDispatchNumberAndCommentDispatchId : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "CompletedDate", table: "Dispatches", type: "datetime2", nullable: true); migrationBuilder.AddColumn( name: "DispatchNumber", table: "Dispatches", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "DispatchId", table: "Comments", type: "int", nullable: true); migrationBuilder.CreateIndex( name: "IX_Comments_DispatchId", table: "Comments", column: "DispatchId"); migrationBuilder.AddForeignKey( name: "FK_Comments_Dispatches_DispatchId", table: "Comments", column: "DispatchId", principalTable: "Dispatches", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Comments_Dispatches_DispatchId", table: "Comments"); migrationBuilder.DropIndex( name: "IX_Comments_DispatchId", table: "Comments"); migrationBuilder.DropColumn( name: "CompletedDate", table: "Dispatches"); migrationBuilder.DropColumn( name: "DispatchNumber", table: "Dispatches"); migrationBuilder.DropColumn( name: "DispatchId", table: "Comments"); } } }