dev
This commit is contained in:
2454
EveryThing/Migrations/20260119165503_16.Designer.cs
generated
Normal file
2454
EveryThing/Migrations/20260119165503_16.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
56
EveryThing/Migrations/20260119165503_16.cs
Normal file
56
EveryThing/Migrations/20260119165503_16.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,6 +695,9 @@ namespace EveryThing.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("IdProjectFk")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("InvoiceNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -710,6 +713,9 @@ namespace EveryThing.Migrations
|
||||
b.Property<string>("PreText")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int?>("ProjectIdProject")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -722,6 +728,8 @@ namespace EveryThing.Migrations
|
||||
|
||||
b.HasIndex("IdPartnerFk");
|
||||
|
||||
b.HasIndex("ProjectIdProject");
|
||||
|
||||
b.ToTable("Invoices");
|
||||
});
|
||||
|
||||
@@ -1813,9 +1821,16 @@ namespace EveryThing.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("EveryThing.Models.Project.Project", "Project")
|
||||
.WithMany("Invoices")
|
||||
.HasForeignKey("ProjectIdProject")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Partner");
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("EveryThing.Models.Invoice.InvoiceItem", b =>
|
||||
@@ -2366,6 +2381,8 @@ namespace EveryThing.Migrations
|
||||
|
||||
modelBuilder.Entity("EveryThing.Models.Project.Project", b =>
|
||||
{
|
||||
b.Navigation("Invoices");
|
||||
|
||||
b.Navigation("ProjectProjectPart");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user