hrms-api-backend/BMA.EHR.Infrastructure/Migrations/20250619180137_update_table_discipline_add_dna.cs
2025-06-20 01:24:57 +07:00

428 lines
24 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class update_table_discipline_add_dna : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "child1DnaOldId",
table: "RetirementResignEmployeeCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2DnaOldId",
table: "RetirementResignEmployeeCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3DnaOldId",
table: "RetirementResignEmployeeCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4DnaOldId",
table: "RetirementResignEmployeeCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootDnaOldId",
table: "RetirementResignEmployeeCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1DnaOldId",
table: "RetirementResignCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2DnaOldId",
table: "RetirementResignCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3DnaOldId",
table: "RetirementResignCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4DnaOldId",
table: "RetirementResignCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootDnaOldId",
table: "RetirementResignCancels",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child1 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1DnaId",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1Id",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child2 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2DnaId",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2Id",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child3 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3DnaId",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3Id",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child4 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4DnaId",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4Id",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4 ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "root",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน root ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootDnaId",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootId",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RetirementEmployeeQuestions",
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"),
RetirementResignEmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ReasonWork = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุใดท่านจึงตัดสินใจร่วมงานกับกรุงเทพมหานคร")
.Annotation("MySql:CharSet", "utf8mb4"),
ReasonWorkOther = table.Column<string>(type: "longtext", nullable: true, comment: "อื่นๆ เหตุใดท่านจึงตัดสินใจร่วมงานกับกรุงเทพมหานคร")
.Annotation("MySql:CharSet", "utf8mb4"),
TimeThink = table.Column<int>(type: "int", nullable: true, comment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด"),
ExitFactor = table.Column<string>(type: "longtext", nullable: true, comment: "ปัจจัยใดที่ทำให้ท่านตัดสินใจลาออกจากราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
ExitFactorOther = table.Column<string>(type: "longtext", nullable: true, comment: "อื่นๆ ปัจจัยใดที่ทำให้ท่านตัดสินใจลาออกจากราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
Adjust = table.Column<string>(type: "longtext", nullable: true, comment: "อะไรคือสิ่งที่ท่านเห็นว่าควรปรับปรุง")
.Annotation("MySql:CharSet", "utf8mb4"),
AdjustOther = table.Column<string>(type: "longtext", nullable: true, comment: "อื่นๆ อะไรคือสิ่งที่ท่านเห็นว่าควรปรับปรุง")
.Annotation("MySql:CharSet", "utf8mb4"),
RealReason = table.Column<string>(type: "longtext", nullable: true, comment: "โปรดระบุสาเหตุที่แท้จริง ที่ทำให้ท่านตัดสินใจลาออกจากการปฏิบัติราชการกับกรุงเทพมหานคร")
.Annotation("MySql:CharSet", "utf8mb4"),
NotExitFactor = table.Column<string>(type: "longtext", nullable: true, comment: "ปัจจัยใดที่จะช่วยทำให้ท่านเปลี่ยนใจ ไม่อยากลาออกจากการปฏิบัติราชการกับกรุงเทพมหานคร")
.Annotation("MySql:CharSet", "utf8mb4"),
Havejob = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "ท่านมีงานใหม่หรือไม่และอะไรคือสิ่งที่ที่ทำงานใหม่ให้กับท่าน ซึ่งท่านรู้สึกว่าเป็นที่น่าพอใจมากกว่าการปฏิบัติราชการกับกรุงเทพมหานคร"),
HavejobReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลท่านมีงานใหม่หรือไม่และอะไรคือสิ่งที่ที่ทำงานใหม่ให้กับท่าน ซึ่งท่านรู้สึกว่าเป็นที่น่าพอใจมากกว่าการปฏิบัติราชการกับกรุงเทพมหานคร")
.Annotation("MySql:CharSet", "utf8mb4"),
SuggestFriends = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "ท่านจะแนะนำเพื่อนให้มาร่วมงานกับกรุงเทพมหานครหรือไม่"),
SuggestFriendsReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลท่านจะแนะนำเพื่อนให้มาร่วมงานกับกรุงเทพมหานครหรือไม่")
.Annotation("MySql:CharSet", "utf8mb4"),
FutureWork = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "หากท่านมีโอกาสในอนาคต ท่านอยากกลับมาร่วมงานกับกรุงเทพมหานครหรือไม่"),
FutureWorkReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลหากท่านมีโอกาสในอนาคต ท่านอยากกลับมาร่วมงานกับกรุงเทพมหานครหรือไม่")
.Annotation("MySql:CharSet", "utf8mb4"),
Suggestion = table.Column<string>(type: "longtext", nullable: true, comment: "ความคิดเห็นและข้อเสนอแนะอื่น ๆ ")
.Annotation("MySql:CharSet", "utf8mb4"),
AppointDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก"),
Score1 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 1"),
Score2 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 2"),
Score3 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 3"),
Score4 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 4"),
Score5 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 5"),
Score6 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 6"),
Score7 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 7"),
Score8 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 8"),
Score9 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 9"),
Score10 = table.Column<int>(type: "int", nullable: true, comment: "คะแนนข้อ 10"),
ScoreTotal = table.Column<int>(type: "int", nullable: true, comment: "คะแนนรวม"),
Comment = table.Column<string>(type: "longtext", nullable: true, comment: "ความคิดเห็น")
.Annotation("MySql:CharSet", "utf8mb4"),
root = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน root ")
.Annotation("MySql:CharSet", "utf8mb4"),
rootId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน root ")
.Annotation("MySql:CharSet", "utf8mb4"),
rootDnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน root ")
.Annotation("MySql:CharSet", "utf8mb4"),
child1 = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child1 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child1Id = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child1 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child1DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child1 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child2 = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child2 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child2Id = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child2 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child2DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child2 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child3 = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child3 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child3Id = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child3 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child3DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child3 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child4 = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child4 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child4Id = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child4 ")
.Annotation("MySql:CharSet", "utf8mb4"),
child4DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child4 ")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementEmployeeQuestions", x => x.Id);
table.ForeignKey(
name: "FK_RetirementEmployeeQuestions_RetirementResignEmployees_Retire~",
column: x => x.RetirementResignEmployeeId,
principalTable: "RetirementResignEmployees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_RetirementEmployeeQuestions_RetirementResignEmployeeId",
table: "RetirementEmployeeQuestions",
column: "RetirementResignEmployeeId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RetirementEmployeeQuestions");
migrationBuilder.DropColumn(
name: "child1DnaOldId",
table: "RetirementResignEmployeeCancels");
migrationBuilder.DropColumn(
name: "child2DnaOldId",
table: "RetirementResignEmployeeCancels");
migrationBuilder.DropColumn(
name: "child3DnaOldId",
table: "RetirementResignEmployeeCancels");
migrationBuilder.DropColumn(
name: "child4DnaOldId",
table: "RetirementResignEmployeeCancels");
migrationBuilder.DropColumn(
name: "rootDnaOldId",
table: "RetirementResignEmployeeCancels");
migrationBuilder.DropColumn(
name: "child1DnaOldId",
table: "RetirementResignCancels");
migrationBuilder.DropColumn(
name: "child2DnaOldId",
table: "RetirementResignCancels");
migrationBuilder.DropColumn(
name: "child3DnaOldId",
table: "RetirementResignCancels");
migrationBuilder.DropColumn(
name: "child4DnaOldId",
table: "RetirementResignCancels");
migrationBuilder.DropColumn(
name: "rootDnaOldId",
table: "RetirementResignCancels");
migrationBuilder.DropColumn(
name: "child1",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child1DnaId",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child1Id",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child2",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child2DnaId",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child2Id",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child3",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child3DnaId",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child3Id",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child4",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child4DnaId",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "child4Id",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "root",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "rootDnaId",
table: "RetirementQuestions");
migrationBuilder.DropColumn(
name: "rootId",
table: "RetirementQuestions");
}
}
}