Files
everything/EveryThing/Migrations/20260119165503_16.cs
2026-01-19 18:02:55 +01:00

57 lines
1.7 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EveryThing.Migrations
{
public partial class _16 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "IdProjectFk",
table: "Invoices",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "ProjectIdProject",
table: "Invoices",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Invoices_ProjectIdProject",
table: "Invoices",
column: "ProjectIdProject");
migrationBuilder.AddForeignKey(
name: "FK_Invoices_Projects_ProjectIdProject",
table: "Invoices",
column: "ProjectIdProject",
principalTable: "Projects",
principalColumn: "IdProject",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Invoices_Projects_ProjectIdProject",
table: "Invoices");
migrationBuilder.DropIndex(
name: "IX_Invoices_ProjectIdProject",
table: "Invoices");
migrationBuilder.DropColumn(
name: "IdProjectFk",
table: "Invoices");
migrationBuilder.DropColumn(
name: "ProjectIdProject",
table: "Invoices");
}
}
}