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