Files
Backend-Api/CompanyManagment.EFCore/Migrations/20250611105314_add rollcall in checkout.cs

125 lines
5.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addrollcallincheckout : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalBreakTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalPresentTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalWorkingTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.CreateTable(
name: "CheckoutRollCallDay",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
FirstStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
FirstEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
SecondStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
SecondEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
BreakTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
WorkingTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
IsSliced = table.Column<bool>(type: "bit", nullable: false),
IsAbsent = table.Column<bool>(type: "bit", nullable: false),
IsFriday = table.Column<bool>(type: "bit", nullable: false),
IsHoliday = table.Column<bool>(type: "bit", nullable: false),
LeaveType = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
CheckoutId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CheckoutRollCallDay", x => x.Id);
table.ForeignKey(
name: "FK_CheckoutRollCallDay_Checkouts_CheckoutId",
column: x => x.CheckoutId,
principalTable: "Checkouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CheckoutRollCallDay_CheckoutId",
table: "CheckoutRollCallDay",
column: "CheckoutId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckoutRollCallDay");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalBreakTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalPresentTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalWorkingTimeSpan",
table: "Checkouts");
}
}
}