using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ComputerHardwareStoreDatabaseImplement.Migrations { /// public partial class fix : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Orders_Products_ProductId", table: "Orders"); migrationBuilder.DropIndex( name: "IX_Orders_ProductId", table: "Orders"); migrationBuilder.DropColumn( name: "Count", table: "Orders"); migrationBuilder.DropColumn( name: "ProductId", table: "Orders"); migrationBuilder.CreateIndex( name: "IX_Comments_BuildId", table: "Comments", column: "BuildId"); migrationBuilder.AddForeignKey( name: "FK_Comments_Builds_BuildId", table: "Comments", column: "BuildId", principalTable: "Builds", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Comments_Builds_BuildId", table: "Comments"); migrationBuilder.DropIndex( name: "IX_Comments_BuildId", table: "Comments"); migrationBuilder.AddColumn( name: "Count", table: "Orders", type: "integer", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "ProductId", table: "Orders", type: "integer", nullable: true); migrationBuilder.CreateIndex( name: "IX_Orders_ProductId", table: "Orders", column: "ProductId"); migrationBuilder.AddForeignKey( name: "FK_Orders_Products_ProductId", table: "Orders", column: "ProductId", principalTable: "Products", principalColumn: "Id"); } } }