using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CarShowroomDatabaseStorage.Migrations { /// public partial class changeCarsAndSale : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_sale_car_sale_sale_id", table: "sale_car"); migrationBuilder.DropForeignKey( name: "FK_sale_service_sale_sale_id", table: "sale_service"); migrationBuilder.AddColumn( name: "car_issaled", table: "car", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddForeignKey( name: "FK_sale_car_sale_sale_id", table: "sale_car", column: "sale_id", principalTable: "sale", principalColumn: "sale_id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_sale_service_sale_sale_id", table: "sale_service", column: "sale_id", principalTable: "sale", principalColumn: "sale_id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_sale_car_sale_sale_id", table: "sale_car"); migrationBuilder.DropForeignKey( name: "FK_sale_service_sale_sale_id", table: "sale_service"); migrationBuilder.DropColumn( name: "car_issaled", table: "car"); migrationBuilder.AddForeignKey( name: "FK_sale_car_sale_sale_id", table: "sale_car", column: "sale_id", principalTable: "sale", principalColumn: "sale_id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_sale_service_sale_sale_id", table: "sale_service", column: "sale_id", principalTable: "sale", principalColumn: "sale_id", onDelete: ReferentialAction.Restrict); } } }