hrms-api-backend/BMA.EHR.Infrastructure/Migrations/LeaveDb/20231204041453_Add DirectorComment and IsComplete to LeaveRequest.cs
Suphonchai Phoonsawat 0c2814e53b add
LV2_015 - รายการขอยกเลิกการลา (ADMIN)
LV2_008 - ขอยกเลิกการลา (USER)
2023-12-04 12:10:46 +07:00

94 lines
3.6 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
{
/// <inheritdoc />
public partial class AddDirectorCommentandIsCompletetoLeaveRequest : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "LeaveStatus",
table: "LeaveRequests",
type: "longtext",
nullable: false,
comment: "สถานะของคำร้อง",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LeaveComment",
table: "LeaveRequests",
type: "longtext",
nullable: true,
comment: "ความเห็นของผู้บังคับบัญชา",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "IsComplete",
table: "LeaveRequests",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการทำงานของคำขอว่าสิ้นสุดการทำงานหรือไม่");
migrationBuilder.AddColumn<string>(
name: "LeaveDirectorComment",
table: "LeaveRequests",
type: "longtext",
nullable: true,
comment: "ความเห็นของผู้อำนวยการสำนัก")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsComplete",
table: "LeaveRequests");
migrationBuilder.DropColumn(
name: "LeaveDirectorComment",
table: "LeaveRequests");
migrationBuilder.AlterColumn<string>(
name: "LeaveStatus",
table: "LeaveRequests",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "สถานะของคำร้อง")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "LeaveRequests",
keyColumn: "LeaveComment",
keyValue: null,
column: "LeaveComment",
value: "");
migrationBuilder.AlterColumn<string>(
name: "LeaveComment",
table: "LeaveRequests",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ความเห็นของผู้บังคับบัญชา")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}