using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CompanyManagment.EFCore.Migrations { /// public partial class initialcontracitngpartybankaccounts : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ContractingPartyBankAccounts", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ContractingPartyId = table.Column(type: "bigint", nullable: false), CardNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), AccountHolderName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), AccountNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), IBan = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), IsAuth = table.Column(type: "bit", nullable: false), CreationDate = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ContractingPartyBankAccounts"); } } }