using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
///
public partial class addsalaryAidandloantocheckout : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CheckoutLoanInstallment",
columns: table => new
{
Checkoutid = table.Column(type: "bigint", nullable: false),
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AmountForMonth = table.Column(type: "nvarchar(25)", maxLength: 25, nullable: true),
Month = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: true),
Year = table.Column(type: "nvarchar(4)", maxLength: 4, nullable: true),
LoanRemaining = table.Column(type: "nvarchar(25)", maxLength: 25, nullable: true),
IsActive = table.Column(type: "nvarchar(5)", maxLength: 5, nullable: false),
LoanAmount = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CheckoutLoanInstallment", x => new { x.Checkoutid, x.Id });
table.ForeignKey(
name: "FK_CheckoutLoanInstallment_Checkouts_Checkoutid",
column: x => x.Checkoutid,
principalTable: "Checkouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CheckoutSalaryAid",
columns: table => new
{
Checkoutid = table.Column(type: "bigint", nullable: false),
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Amount = table.Column(type: "nvarchar(25)", maxLength: 25, nullable: true),
SalaryAidDateTime = table.Column(type: "datetime2", nullable: false),
SalaryAidDateTimeFa = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true),
CalculationDateTime = table.Column(type: "datetime2", nullable: false),
CalculationDateTimeFa = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CheckoutSalaryAid", x => new { x.Checkoutid, x.Id });
table.ForeignKey(
name: "FK_CheckoutSalaryAid_Checkouts_Checkoutid",
column: x => x.Checkoutid,
principalTable: "Checkouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckoutLoanInstallment");
migrationBuilder.DropTable(
name: "CheckoutSalaryAid");
}
}
}