using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class commentsdatabasechange : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Quotes_workOrders_ProposalforId", table: "Quotes"); migrationBuilder.DropColumn( name: "Latitude", table: "Comments"); migrationBuilder.DropColumn( name: "Longitude", table: "Comments"); migrationBuilder.DropColumn( name: "Name", table: "Comments"); migrationBuilder.RenameColumn( name: "ProposalforId", table: "Quotes", newName: "WorkorderId"); migrationBuilder.RenameColumn( name: "POC", table: "Quotes", newName: "BillingAddress"); migrationBuilder.RenameIndex( name: "IX_Quotes_ProposalforId", table: "Quotes", newName: "IX_Quotes_WorkorderId"); migrationBuilder.RenameColumn( name: "Title", table: "Comments", newName: "Commenttext"); migrationBuilder.AddColumn( name: "UserId", table: "Comments", type: "nvarchar(450)", nullable: true); migrationBuilder.CreateIndex( name: "IX_Comments_UserId", table: "Comments", column: "UserId"); migrationBuilder.AddForeignKey( name: "FK_Comments_AspNetUsers_UserId", table: "Comments", column: "UserId", principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Quotes_workOrders_WorkorderId", table: "Quotes", column: "WorkorderId", principalTable: "workOrders", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Comments_AspNetUsers_UserId", table: "Comments"); migrationBuilder.DropForeignKey( name: "FK_Quotes_workOrders_WorkorderId", table: "Quotes"); migrationBuilder.DropIndex( name: "IX_Comments_UserId", table: "Comments"); migrationBuilder.DropColumn( name: "UserId", table: "Comments"); migrationBuilder.RenameColumn( name: "WorkorderId", table: "Quotes", newName: "ProposalforId"); migrationBuilder.RenameColumn( name: "BillingAddress", table: "Quotes", newName: "POC"); migrationBuilder.RenameIndex( name: "IX_Quotes_WorkorderId", table: "Quotes", newName: "IX_Quotes_ProposalforId"); migrationBuilder.RenameColumn( name: "Commenttext", table: "Comments", newName: "Title"); migrationBuilder.AddColumn( name: "Latitude", table: "Comments", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "Longitude", table: "Comments", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "Name", table: "Comments", type: "nvarchar(max)", nullable: true); migrationBuilder.AddForeignKey( name: "FK_Quotes_workOrders_ProposalforId", table: "Quotes", column: "ProposalforId", principalTable: "workOrders", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } } }