This commit is contained in:
fedpo
2024-09-08 02:39:13 +01:00
parent c15ae743ab
commit 393caac989
65 changed files with 1138 additions and 282 deletions

View File

@@ -0,0 +1,95 @@
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);
}
}
}