Files
Backend-Api/CompanyManagment.EFCore/Migrations/20250726105745_initial contracitngpartybank accounts.cs
2025-07-26 15:58:01 +03:30

53 lines
2.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class initialcontracitngpartybankaccounts : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ContractingPartyBankAccounts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ContractingPartyId = table.Column<long>(type: "bigint", nullable: false),
CardNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
AccountHolderName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
AccountNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
IBan = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
IsAuth = table.Column<bool>(type: "bit", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ContractingPartyBankAccounts", x => x.id);
table.ForeignKey(
name: "FK_ContractingPartyBankAccounts_PersonalContractingParties_ContractingPartyId",
column: x => x.ContractingPartyId,
principalTable: "PersonalContractingParties",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ContractingPartyBankAccounts_ContractingPartyId",
table: "ContractingPartyBankAccounts",
column: "ContractingPartyId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ContractingPartyBankAccounts");
}
}
}