hrms-api-backend/BMA.EHR.Infrastructure/Migrations/20241029100828_update table RetirementResignCancel.cs
2024-10-29 17:48:41 +07:00

156 lines
15 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableRetirementResignCancel : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RetirementResignCancels",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
Location = table.Column<string>(type: "longtext", nullable: true, comment: "สถานที่ยื่นขอลาออกราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
SendDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยื่นขอออกราชการ"),
ActiveDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ขอออกราชการ"),
Reason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลที่ลาออกจากราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationPositionOld = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionTypeOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionLevelOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionNumberOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่")
.Annotation("MySql:CharSet", "utf8mb4"),
AmountOld = table.Column<double>(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"),
Status = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะลาออก")
.Annotation("MySql:CharSet", "utf8mb4"),
ApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติ")
.Annotation("MySql:CharSet", "utf8mb4"),
RejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลไม่อนุมัติ")
.Annotation("MySql:CharSet", "utf8mb4"),
CancelReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยกเลิก")
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"),
IsNoDebt = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะไม่เป็นหนี้สหกรณ์"),
IsNoBurden = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะไม่มีภาระผูกพันค้ำประกันทุนการศึกษา"),
IsDiscipline = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะพฤติการณ์ทางวินัย"),
OligarchReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งผู้ดูแล"),
OligarchApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติผู้ดูแล")
.Annotation("MySql:CharSet", "utf8mb4"),
OligarchRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งผู้ดูแล")
.Annotation("MySql:CharSet", "utf8mb4"),
OligarchRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งผู้ดูแล"),
CommanderReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งผู้บังคับบัญชา"),
CommanderApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติผู้บังคับบัญชา")
.Annotation("MySql:CharSet", "utf8mb4"),
CommanderRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งผู้บังคับบัญชา")
.Annotation("MySql:CharSet", "utf8mb4"),
CommanderRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งผู้บังคับบัญชา"),
OfficerReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งการเจ้าหน้าที่"),
OfficerApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติการเจ้าหน้าที่")
.Annotation("MySql:CharSet", "utf8mb4"),
OfficerRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งการเจ้าหน้าที่")
.Annotation("MySql:CharSet", "utf8mb4"),
OfficerRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งการเจ้าหน้าที่"),
RemarkHorizontal = table.Column<string>(type: "longtext", nullable: true, comment: "หมายเหตุแนวนอน")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationOld = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionOld = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4"),
profileId = table.Column<string>(type: "longtext", nullable: true, comment: "profile Id")
.Annotation("MySql:CharSet", "utf8mb4"),
prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4"),
firstName = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
lastName = table.Column<string>(type: "longtext", nullable: true, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
citizenId = table.Column<string>(type: "longtext", nullable: true, comment: "เลขบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
rootOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
rootOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
rootShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
posMasterNoOld = table.Column<int>(type: "int", nullable: true, comment: "เลขที่ตำแหน่ง old"),
posTypeOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id ประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posTypeNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posLevelOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id ระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posLevelNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
RetirementResignId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementResignCancels", x => x.Id);
table.ForeignKey(
name: "FK_RetirementResignCancels_RetirementResigns_RetirementResignId",
column: x => x.RetirementResignId,
principalTable: "RetirementResigns",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_RetirementResignCancels_RetirementResignId",
table: "RetirementResignCancels",
column: "RetirementResignId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RetirementResignCancels");
}
}
}