- Altered LeaveDays column to update its comment. - Added BeginningLeaveCount column to track the number of leave occurrences. - Added BeginningLeaveDays column to store the total days of leave carried over.
62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddBeginningLeaveandLeaveCounttoLeaveBeginning : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<double>(
|
|
name: "LeaveDays",
|
|
table: "LeaveBeginnings",
|
|
type: "double",
|
|
nullable: false,
|
|
comment: "จำนวนวันลาทั้งหมด",
|
|
oldClrType: typeof(double),
|
|
oldType: "double",
|
|
oldComment: "จำนวนวันลายกมา");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "BeginningLeaveCount",
|
|
table: "LeaveBeginnings",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "จำนวนครั้งที่ลายกมา");
|
|
|
|
migrationBuilder.AddColumn<double>(
|
|
name: "BeginningLeaveDays",
|
|
table: "LeaveBeginnings",
|
|
type: "double",
|
|
nullable: false,
|
|
defaultValue: 0.0,
|
|
comment: "จำนวนวันลายกมา");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "BeginningLeaveCount",
|
|
table: "LeaveBeginnings");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "BeginningLeaveDays",
|
|
table: "LeaveBeginnings");
|
|
|
|
migrationBuilder.AlterColumn<double>(
|
|
name: "LeaveDays",
|
|
table: "LeaveBeginnings",
|
|
type: "double",
|
|
nullable: false,
|
|
comment: "จำนวนวันลายกมา",
|
|
oldClrType: typeof(double),
|
|
oldType: "double",
|
|
oldComment: "จำนวนวันลาทั้งหมด");
|
|
}
|
|
}
|
|
}
|