using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Modelo.Migrations { /// public partial class funcatodo : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_DetallesFacturas_Producto_IdProducto", table: "DetallesFacturas"); migrationBuilder.DropColumn( name: "IdProducto", table: "Lotes"); migrationBuilder.DropColumn( name: "IdProducto", table: "DetallePresupuestos"); migrationBuilder.DropColumn( name: "IdProducto", table: "DetalleOrdenDeCompras"); migrationBuilder.RenameColumn( name: "IdProducto", table: "DetallesFacturas", newName: "ProductoId"); migrationBuilder.RenameIndex( name: "IX_DetallesFacturas_IdProducto", table: "DetallesFacturas", newName: "IX_DetallesFacturas_ProductoId"); migrationBuilder.AddForeignKey( name: "FK_DetallesFacturas_Producto_ProductoId", table: "DetallesFacturas", column: "ProductoId", principalTable: "Producto", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_DetallesFacturas_Producto_ProductoId", table: "DetallesFacturas"); migrationBuilder.RenameColumn( name: "ProductoId", table: "DetallesFacturas", newName: "IdProducto"); migrationBuilder.RenameIndex( name: "IX_DetallesFacturas_ProductoId", table: "DetallesFacturas", newName: "IX_DetallesFacturas_IdProducto"); migrationBuilder.AddColumn( name: "IdProducto", table: "Lotes", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "IdProducto", table: "DetallePresupuestos", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "IdProducto", table: "DetalleOrdenDeCompras", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddForeignKey( name: "FK_DetallesFacturas_Producto_IdProducto", table: "DetallesFacturas", column: "IdProducto", principalTable: "Producto", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }