Files
Backend-Api/CompanyManagment.EFCore/Migrations/20250423132557_add salaryAid and loan to checkout.cs
2025-04-23 17:06:12 +03:30

75 lines
3.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addsalaryAidandloantocheckout : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CheckoutLoanInstallment",
columns: table => new
{
Checkoutid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AmountForMonth = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
Month = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true),
Year = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true),
LoanRemaining = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
IsActive = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
LoanAmount = table.Column<string>(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<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Amount = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
SalaryAidDateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
SalaryAidDateTimeFa = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
CalculationDateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CalculationDateTimeFa = table.Column<string>(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);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckoutLoanInstallment");
migrationBuilder.DropTable(
name: "CheckoutSalaryAid");
}
}
}