43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CompanyManagment.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class ContractingPartyAccount : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "ContractingPartyAccount",
|
|
columns: table => new
|
|
{
|
|
ContractingPartyId = table.Column<long>(type: "bigint", nullable: false),
|
|
AccountId = table.Column<long>(type: "bigint", nullable: false),
|
|
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ContractingPartyAccount", x => new { x.ContractingPartyId, x.AccountId });
|
|
table.ForeignKey(
|
|
name: "FK_ContractingPartyAccount_PersonalContractingParties_ContractingPartyId",
|
|
column: x => x.ContractingPartyId,
|
|
principalTable: "PersonalContractingParties",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "ContractingPartyAccount");
|
|
}
|
|
}
|
|
}
|