Premier commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SIFinance.Shared.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddContratIdToFactures : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "contrat_id",
|
||||
schema: "fin",
|
||||
table: "factures",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_factures_contrat_id",
|
||||
schema: "fin",
|
||||
table: "factures",
|
||||
column: "contrat_id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_factures_contrat",
|
||||
schema: "fin",
|
||||
table: "factures",
|
||||
column: "contrat_id",
|
||||
principalSchema: "achats",
|
||||
principalTable: "contrats_fournisseurs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_factures_contrat",
|
||||
schema: "fin",
|
||||
table: "factures");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_factures_contrat_id",
|
||||
schema: "fin",
|
||||
table: "factures");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "contrat_id",
|
||||
schema: "fin",
|
||||
table: "factures");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user