using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
///
public partial class addauthorizedbankdetails : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AuthorizedBankDetails",
columns: table => new
{
id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CardNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
AccountNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
IBan = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
BankName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
CreationDate = table.Column(type: "datetime2", nullable: false)
},
constraints: table => { table.PrimaryKey("PK_AuthorizedBankDetails", x => x.id); });
migrationBuilder.CreateTable(
name: "AuthorizedBankDetailsOwners",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
LName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
NationalIdentifier = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true),
CustomerType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
AuthorizedBankDetailsId = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AuthorizedBankDetailsOwners", x => x.Id);
table.ForeignKey(
name: "FK_AuthorizedBankDetailsOwners_AuthorizedBankDetails_AuthorizedBankDetailsId",
column: x => x.AuthorizedBankDetailsId,
principalTable: "AuthorizedBankDetails",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AuthorizedBankDetailsOwners_AuthorizedBankDetailsId",
table: "AuthorizedBankDetailsOwners",
column: "AuthorizedBankDetailsId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AuthorizedBankDetailsOwners");
migrationBuilder.DropTable(
name: "AuthorizedBankDetails");
}
}
}