Files
Final_Das/Modelo/Migrations/20240907203054_funcatodo.cs
2024-09-08 02:39:13 +01:00

96 lines
3.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Modelo.Migrations
{
/// <inheritdoc />
public partial class funcatodo : Migration
{
/// <inheritdoc />
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);
}
/// <inheritdoc />
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<int>(
name: "IdProducto",
table: "Lotes",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "IdProducto",
table: "DetallePresupuestos",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
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);
}
}
}