using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class updatetablePlacementOutaddchild1 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_BloodGroups_BloodGroupId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_Genders_GenderId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_OrganizationEmployees_OrgEmployeeId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_OrganizationPositions_OrganizationPosi~",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionEmployeeLines_PositionEmployee~",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionEmployeePositions_PositionEmpl~",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionEmployeeStatuses_PositionEmplo~",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionLevels_PositionLevelId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionLines_PositionLineId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionNumbers_PositionNumberId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionPathSides_PositionPathSideId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionPaths_PositionPathId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_PositionTypes_PositionTypeId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_Prefixes_PrefixId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_Profiles_ProfileId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_Relationships_RelationshipId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_PlacementAppointments_Religions_ReligionId",
                table: "PlacementAppointments");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementDeceaseds_Profiles_ProfileId",
                table: "RetirementDeceaseds");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_BloodGroups_BloodGroupId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_Genders_GenderId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_OrganizationPositions_OrganizationPositionId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_PositionLevels_PositionLevelId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_PositionLines_PositionLineId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_PositionNumbers_PositionNumberId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_PositionPathSides_PositionPathSideId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_PositionPaths_PositionPathId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_PositionTypes_PositionTypeId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_Prefixes_PrefixId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_Profiles_ProfileId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_Relationships_RelationshipId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOthers_Religions_ReligionId",
                table: "RetirementOthers");

            migrationBuilder.DropForeignKey(
                name: "FK_RetirementOuts_Profiles_ProfileId",
                table: "RetirementOuts");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOuts_ProfileId",
                table: "RetirementOuts");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_BloodGroupId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_GenderId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_OrganizationPositionId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_PositionLevelId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_PositionLineId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_PositionNumberId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_PositionPathId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_PositionPathSideId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_PositionTypeId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_PrefixId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_ProfileId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_RelationshipId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementOthers_ReligionId",
                table: "RetirementOthers");

            migrationBuilder.DropIndex(
                name: "IX_RetirementDeceaseds_ProfileId",
                table: "RetirementDeceaseds");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_BloodGroupId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_GenderId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_OrganizationPositionId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_OrgEmployeeId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionEmployeeLineId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionEmployeePositionId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionEmployeeStatusId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionLevelId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionLineId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionNumberId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionPathId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionPathSideId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PositionTypeId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_PrefixId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_ProfileId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_RelationshipId",
                table: "PlacementAppointments");

            migrationBuilder.DropIndex(
                name: "IX_PlacementAppointments_ReligionId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "BloodGroupId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "DateOfBirth",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "GenderId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "Nationality",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "OrganizationPositionId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "PositionLevelId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "PositionLineId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "PositionNumberId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "PositionPathId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "PositionPathSideId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "PositionTypeId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "PrefixId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "Race",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "RelationshipId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "ReligionId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "TelephoneNumber",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "BloodGroupId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "DateOfBirth",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "GenderId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "Nationality",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "OrgEmployeeId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "OrganizationPositionId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionEmployeeLineId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionEmployeePositionId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionEmployeeStatusId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionLevelId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionLineId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionNumberId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionPathId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionPathSideId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PositionTypeId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "PrefixId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "Race",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "RelationshipId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "ReligionId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "TelephoneNumber",
                table: "PlacementAppointments");

            migrationBuilder.RenameColumn(
                name: "ProfileId",
                table: "RetirementOuts",
                newName: "profileId");

            migrationBuilder.RenameColumn(
                name: "ProfileId",
                table: "RetirementOthers",
                newName: "profileId");

            migrationBuilder.RenameColumn(
                name: "Lastname",
                table: "RetirementOthers",
                newName: "lastName");

            migrationBuilder.RenameColumn(
                name: "Firstname",
                table: "RetirementOthers",
                newName: "firstName");

            migrationBuilder.RenameColumn(
                name: "CitizenId",
                table: "RetirementOthers",
                newName: "citizenId");

            migrationBuilder.RenameColumn(
                name: "ProfileId",
                table: "RetirementDeceaseds",
                newName: "profileId");

            migrationBuilder.RenameColumn(
                name: "ProfileId",
                table: "PlacementAppointments",
                newName: "profileId");

            migrationBuilder.RenameColumn(
                name: "Lastname",
                table: "PlacementAppointments",
                newName: "lastName");

            migrationBuilder.RenameColumn(
                name: "Firstname",
                table: "PlacementAppointments",
                newName: "firstName");

            migrationBuilder.RenameColumn(
                name: "CitizenId",
                table: "PlacementAppointments",
                newName: "citizenId");

            migrationBuilder.AlterColumn<string>(
                name: "profileId",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "profile Id",
                oldClrType: typeof(Guid),
                oldType: "char(36)")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "child1",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1Id",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1ShortName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2Id",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2ShortName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3Id",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3ShortName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4Id",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4ShortName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "citizenId",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "เลขบัตรประชาชน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "firstName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "lastName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "นามสกุล")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelId",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "id ระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "posMasterNo",
                table: "RetirementOuts",
                type: "int",
                nullable: true,
                comment: "เลขที่ตำแหน่ง");

            migrationBuilder.AddColumn<string>(
                name: "posTypeId",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "id ประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posTypeName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "position",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อตำแหน่งในสายงาน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "prefix",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "คำนำหน้า")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "root",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootId",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootShortName",
                table: "RetirementOuts",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "profileId",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "profile Id",
                oldClrType: typeof(Guid),
                oldType: "char(36)")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AlterColumn<string>(
                name: "lastName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "นามสกุล",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "นามสกุล")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "firstName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อ",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "ชื่อ")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "citizenId",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "เลขบัตรประชาชน",
                oldClrType: typeof(string),
                oldType: "varchar(20)",
                oldMaxLength: 20,
                oldComment: "เลขประจำตัวประชาชน")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1Id",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1ShortName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2Id",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2ShortName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3Id",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3ShortName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4Id",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4ShortName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelId",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "id ระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "posMasterNo",
                table: "RetirementOthers",
                type: "int",
                nullable: true,
                comment: "เลขที่ตำแหน่ง");

            migrationBuilder.AddColumn<string>(
                name: "posTypeId",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "id ประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posTypeName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "position",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อตำแหน่งในสายงาน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "prefix",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "คำนำหน้า")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "root",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootId",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootShortName",
                table: "RetirementOthers",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "profileId",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "profile Id",
                oldClrType: typeof(Guid),
                oldType: "char(36)")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "child1",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1Id",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1ShortName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2Id",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2ShortName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3Id",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3ShortName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4Id",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4ShortName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "citizenId",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "เลขบัตรประชาชน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "firstName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "lastName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "นามสกุล")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelId",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "id ระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "posMasterNo",
                table: "RetirementDeceaseds",
                type: "int",
                nullable: true,
                comment: "เลขที่ตำแหน่ง");

            migrationBuilder.AddColumn<string>(
                name: "posTypeId",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "id ประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posTypeName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "position",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อตำแหน่งในสายงาน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "prefix",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "คำนำหน้า")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "root",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootId",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootShortName",
                table: "RetirementDeceaseds",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "profileId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "profile Id",
                oldClrType: typeof(Guid),
                oldType: "char(36)")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AlterColumn<string>(
                name: "lastName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "นามสกุล",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "นามสกุล")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "firstName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อ",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "ชื่อ")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "citizenId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "เลขบัตรประชาชน",
                oldClrType: typeof(string),
                oldType: "varchar(20)",
                oldMaxLength: 20,
                oldComment: "เลขประจำตัวประชาชน")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1Id",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1Old",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child1 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1OldId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child1 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1ShortName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child1")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child1ShortNameOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child1 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2Id",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2Old",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child2 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2OldId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child2 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2ShortName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child2")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child2ShortNameOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child2 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3Id",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3Old",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child3 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3OldId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child3 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3ShortName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child3")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child3ShortNameOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child3 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4Id",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4Old",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน child4 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4OldId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน child4 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4ShortName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child4")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "child4ShortNameOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน child4 old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "node",
                table: "PlacementAppointments",
                type: "int",
                nullable: true,
                comment: "ระดับโครงสร้าง");

            migrationBuilder.AddColumn<Guid>(
                name: "nodeId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                comment: "id โครงสร้าง",
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "orgRevisionId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id revision")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id ระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อระดับตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelNameOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อระดับตำแหน่ง old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posLevelOldId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id ระดับตำแหน่ง old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "posMasterNo",
                table: "PlacementAppointments",
                type: "int",
                nullable: true,
                comment: "เลขที่ตำแหน่ง");

            migrationBuilder.AddColumn<int>(
                name: "posMasterNoOld",
                table: "PlacementAppointments",
                type: "int",
                nullable: true,
                comment: "เลขที่ตำแหน่ง old");

            migrationBuilder.AddColumn<string>(
                name: "posTypeId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id ประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posTypeName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อประเภทตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posTypeNameOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อประเภทตำแหน่ง old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posTypeOldId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id ประเภทตำแหน่ง old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "positionField",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "สายงาน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "positionId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id ตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "positionName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อตำแหน่งในสายงาน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "positionOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อตำแหน่งในสายงาน old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "posmasterId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id อัตรากำลัง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "prefix",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "คำนำหน้า")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "root",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อหน่วยงาน root old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootOldId",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "id หน่วยงาน root old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootShortName",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน root")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "rootShortNameOld",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ชื่อย่อหน่วยงาน root old")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "type",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: true,
                comment: "ประเภทราชการ")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "child1",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child1Id",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child1ShortName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child2",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child2Id",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child2ShortName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child3",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child3Id",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child3ShortName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child4",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child4Id",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child4ShortName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "citizenId",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "firstName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "lastName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "posLevelId",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "posLevelName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "posMasterNo",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "posTypeId",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "posTypeName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "position",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "prefix",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "root",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "rootId",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "rootShortName",
                table: "RetirementOuts");

            migrationBuilder.DropColumn(
                name: "child1",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child1Id",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child1ShortName",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child2",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child2Id",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child2ShortName",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child3",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child3Id",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child3ShortName",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child4",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child4Id",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child4ShortName",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "posLevelId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "posLevelName",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "posMasterNo",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "posTypeId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "posTypeName",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "position",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "prefix",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "root",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "rootId",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "rootShortName",
                table: "RetirementOthers");

            migrationBuilder.DropColumn(
                name: "child1",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child1Id",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child1ShortName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child2",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child2Id",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child2ShortName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child3",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child3Id",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child3ShortName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child4",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child4Id",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child4ShortName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "citizenId",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "firstName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "lastName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "posLevelId",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "posLevelName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "posMasterNo",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "posTypeId",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "posTypeName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "position",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "prefix",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "root",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "rootId",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "rootShortName",
                table: "RetirementDeceaseds");

            migrationBuilder.DropColumn(
                name: "child1",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child1Id",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child1Old",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child1OldId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child1ShortName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child1ShortNameOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child2",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child2Id",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child2Old",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child2OldId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child2ShortName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child2ShortNameOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child3",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child3Id",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child3Old",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child3OldId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child3ShortName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child3ShortNameOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child4",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child4Id",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child4Old",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child4OldId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child4ShortName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "child4ShortNameOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "node",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "nodeId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "orgRevisionId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posLevelId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posLevelName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posLevelNameOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posLevelOldId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posMasterNo",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posMasterNoOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posTypeId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posTypeName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posTypeNameOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posTypeOldId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "positionField",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "positionId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "positionName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "positionOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "posmasterId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "prefix",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "root",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "rootId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "rootOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "rootOldId",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "rootShortName",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "rootShortNameOld",
                table: "PlacementAppointments");

            migrationBuilder.DropColumn(
                name: "type",
                table: "PlacementAppointments");

            migrationBuilder.RenameColumn(
                name: "profileId",
                table: "RetirementOuts",
                newName: "ProfileId");

            migrationBuilder.RenameColumn(
                name: "profileId",
                table: "RetirementOthers",
                newName: "ProfileId");

            migrationBuilder.RenameColumn(
                name: "lastName",
                table: "RetirementOthers",
                newName: "Lastname");

            migrationBuilder.RenameColumn(
                name: "firstName",
                table: "RetirementOthers",
                newName: "Firstname");

            migrationBuilder.RenameColumn(
                name: "citizenId",
                table: "RetirementOthers",
                newName: "CitizenId");

            migrationBuilder.RenameColumn(
                name: "profileId",
                table: "RetirementDeceaseds",
                newName: "ProfileId");

            migrationBuilder.RenameColumn(
                name: "profileId",
                table: "PlacementAppointments",
                newName: "ProfileId");

            migrationBuilder.RenameColumn(
                name: "lastName",
                table: "PlacementAppointments",
                newName: "Lastname");

            migrationBuilder.RenameColumn(
                name: "firstName",
                table: "PlacementAppointments",
                newName: "Firstname");

            migrationBuilder.RenameColumn(
                name: "citizenId",
                table: "PlacementAppointments",
                newName: "CitizenId");

            migrationBuilder.AlterColumn<Guid>(
                name: "ProfileId",
                table: "RetirementOuts",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "profile Id")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<Guid>(
                name: "ProfileId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "profile Id")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "RetirementOthers",
                keyColumn: "Lastname",
                keyValue: null,
                column: "Lastname",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Lastname",
                table: "RetirementOthers",
                type: "longtext",
                nullable: false,
                comment: "นามสกุล",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "นามสกุล")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "RetirementOthers",
                keyColumn: "Firstname",
                keyValue: null,
                column: "Firstname",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Firstname",
                table: "RetirementOthers",
                type: "longtext",
                nullable: false,
                comment: "ชื่อ",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "ชื่อ")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "RetirementOthers",
                keyColumn: "CitizenId",
                keyValue: null,
                column: "CitizenId",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "CitizenId",
                table: "RetirementOthers",
                type: "varchar(20)",
                maxLength: 20,
                nullable: false,
                comment: "เลขประจำตัวประชาชน",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "เลขบัตรประชาชน")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<Guid>(
                name: "BloodGroupId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<DateTime>(
                name: "DateOfBirth",
                table: "RetirementOthers",
                type: "datetime(6)",
                maxLength: 40,
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                comment: "วันเกิด");

            migrationBuilder.AddColumn<Guid>(
                name: "GenderId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "Nationality",
                table: "RetirementOthers",
                type: "varchar(100)",
                maxLength: 100,
                nullable: true,
                comment: "สัญชาติ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<Guid>(
                name: "OrganizationPositionId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionLevelId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionLineId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionNumberId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionPathId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionPathSideId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionTypeId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PrefixId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "Race",
                table: "RetirementOthers",
                type: "varchar(100)",
                maxLength: 100,
                nullable: true,
                comment: "เชื้อชาติ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<Guid>(
                name: "RelationshipId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "ReligionId",
                table: "RetirementOthers",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "TelephoneNumber",
                table: "RetirementOthers",
                type: "varchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "เบอร์โทร")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<Guid>(
                name: "ProfileId",
                table: "RetirementDeceaseds",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "profile Id")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<Guid>(
                name: "ProfileId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "profile Id")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "PlacementAppointments",
                keyColumn: "Lastname",
                keyValue: null,
                column: "Lastname",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Lastname",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: false,
                comment: "นามสกุล",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "นามสกุล")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "PlacementAppointments",
                keyColumn: "Firstname",
                keyValue: null,
                column: "Firstname",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Firstname",
                table: "PlacementAppointments",
                type: "longtext",
                nullable: false,
                comment: "ชื่อ",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "ชื่อ")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "PlacementAppointments",
                keyColumn: "CitizenId",
                keyValue: null,
                column: "CitizenId",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "CitizenId",
                table: "PlacementAppointments",
                type: "varchar(20)",
                maxLength: 20,
                nullable: false,
                comment: "เลขประจำตัวประชาชน",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "เลขบัตรประชาชน")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<Guid>(
                name: "BloodGroupId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<DateTime>(
                name: "DateOfBirth",
                table: "PlacementAppointments",
                type: "datetime(6)",
                maxLength: 40,
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                comment: "วันเกิด");

            migrationBuilder.AddColumn<Guid>(
                name: "GenderId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "Nationality",
                table: "PlacementAppointments",
                type: "varchar(100)",
                maxLength: 100,
                nullable: true,
                comment: "สัญชาติ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<Guid>(
                name: "OrgEmployeeId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "OrganizationPositionId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionEmployeeLineId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionEmployeePositionId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionEmployeeStatusId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionLevelId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionLineId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionNumberId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionPathId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionPathSideId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PositionTypeId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "PrefixId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "Race",
                table: "PlacementAppointments",
                type: "varchar(100)",
                maxLength: 100,
                nullable: true,
                comment: "เชื้อชาติ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<Guid>(
                name: "RelationshipId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<Guid>(
                name: "ReligionId",
                table: "PlacementAppointments",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "TelephoneNumber",
                table: "PlacementAppointments",
                type: "varchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "เบอร์โทร")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOuts_ProfileId",
                table: "RetirementOuts",
                column: "ProfileId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_BloodGroupId",
                table: "RetirementOthers",
                column: "BloodGroupId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_GenderId",
                table: "RetirementOthers",
                column: "GenderId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_OrganizationPositionId",
                table: "RetirementOthers",
                column: "OrganizationPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_PositionLevelId",
                table: "RetirementOthers",
                column: "PositionLevelId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_PositionLineId",
                table: "RetirementOthers",
                column: "PositionLineId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_PositionNumberId",
                table: "RetirementOthers",
                column: "PositionNumberId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_PositionPathId",
                table: "RetirementOthers",
                column: "PositionPathId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_PositionPathSideId",
                table: "RetirementOthers",
                column: "PositionPathSideId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_PositionTypeId",
                table: "RetirementOthers",
                column: "PositionTypeId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_PrefixId",
                table: "RetirementOthers",
                column: "PrefixId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_ProfileId",
                table: "RetirementOthers",
                column: "ProfileId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_RelationshipId",
                table: "RetirementOthers",
                column: "RelationshipId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementOthers_ReligionId",
                table: "RetirementOthers",
                column: "ReligionId");

            migrationBuilder.CreateIndex(
                name: "IX_RetirementDeceaseds_ProfileId",
                table: "RetirementDeceaseds",
                column: "ProfileId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_BloodGroupId",
                table: "PlacementAppointments",
                column: "BloodGroupId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_GenderId",
                table: "PlacementAppointments",
                column: "GenderId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_OrganizationPositionId",
                table: "PlacementAppointments",
                column: "OrganizationPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_OrgEmployeeId",
                table: "PlacementAppointments",
                column: "OrgEmployeeId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionEmployeeLineId",
                table: "PlacementAppointments",
                column: "PositionEmployeeLineId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionEmployeePositionId",
                table: "PlacementAppointments",
                column: "PositionEmployeePositionId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionEmployeeStatusId",
                table: "PlacementAppointments",
                column: "PositionEmployeeStatusId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionLevelId",
                table: "PlacementAppointments",
                column: "PositionLevelId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionLineId",
                table: "PlacementAppointments",
                column: "PositionLineId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionNumberId",
                table: "PlacementAppointments",
                column: "PositionNumberId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionPathId",
                table: "PlacementAppointments",
                column: "PositionPathId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionPathSideId",
                table: "PlacementAppointments",
                column: "PositionPathSideId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PositionTypeId",
                table: "PlacementAppointments",
                column: "PositionTypeId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_PrefixId",
                table: "PlacementAppointments",
                column: "PrefixId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_ProfileId",
                table: "PlacementAppointments",
                column: "ProfileId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_RelationshipId",
                table: "PlacementAppointments",
                column: "RelationshipId");

            migrationBuilder.CreateIndex(
                name: "IX_PlacementAppointments_ReligionId",
                table: "PlacementAppointments",
                column: "ReligionId");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_BloodGroups_BloodGroupId",
                table: "PlacementAppointments",
                column: "BloodGroupId",
                principalTable: "BloodGroups",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_Genders_GenderId",
                table: "PlacementAppointments",
                column: "GenderId",
                principalTable: "Genders",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_OrganizationEmployees_OrgEmployeeId",
                table: "PlacementAppointments",
                column: "OrgEmployeeId",
                principalTable: "OrganizationEmployees",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_OrganizationPositions_OrganizationPosi~",
                table: "PlacementAppointments",
                column: "OrganizationPositionId",
                principalTable: "OrganizationPositions",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionEmployeeLines_PositionEmployee~",
                table: "PlacementAppointments",
                column: "PositionEmployeeLineId",
                principalTable: "PositionEmployeeLines",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionEmployeePositions_PositionEmpl~",
                table: "PlacementAppointments",
                column: "PositionEmployeePositionId",
                principalTable: "PositionEmployeePositions",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionEmployeeStatuses_PositionEmplo~",
                table: "PlacementAppointments",
                column: "PositionEmployeeStatusId",
                principalTable: "PositionEmployeeStatuses",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionLevels_PositionLevelId",
                table: "PlacementAppointments",
                column: "PositionLevelId",
                principalTable: "PositionLevels",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionLines_PositionLineId",
                table: "PlacementAppointments",
                column: "PositionLineId",
                principalTable: "PositionLines",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionNumbers_PositionNumberId",
                table: "PlacementAppointments",
                column: "PositionNumberId",
                principalTable: "PositionNumbers",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionPathSides_PositionPathSideId",
                table: "PlacementAppointments",
                column: "PositionPathSideId",
                principalTable: "PositionPathSides",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionPaths_PositionPathId",
                table: "PlacementAppointments",
                column: "PositionPathId",
                principalTable: "PositionPaths",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_PositionTypes_PositionTypeId",
                table: "PlacementAppointments",
                column: "PositionTypeId",
                principalTable: "PositionTypes",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_Prefixes_PrefixId",
                table: "PlacementAppointments",
                column: "PrefixId",
                principalTable: "Prefixes",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_Profiles_ProfileId",
                table: "PlacementAppointments",
                column: "ProfileId",
                principalTable: "Profiles",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_Relationships_RelationshipId",
                table: "PlacementAppointments",
                column: "RelationshipId",
                principalTable: "Relationships",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PlacementAppointments_Religions_ReligionId",
                table: "PlacementAppointments",
                column: "ReligionId",
                principalTable: "Religions",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementDeceaseds_Profiles_ProfileId",
                table: "RetirementDeceaseds",
                column: "ProfileId",
                principalTable: "Profiles",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_BloodGroups_BloodGroupId",
                table: "RetirementOthers",
                column: "BloodGroupId",
                principalTable: "BloodGroups",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_Genders_GenderId",
                table: "RetirementOthers",
                column: "GenderId",
                principalTable: "Genders",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_OrganizationPositions_OrganizationPositionId",
                table: "RetirementOthers",
                column: "OrganizationPositionId",
                principalTable: "OrganizationPositions",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_PositionLevels_PositionLevelId",
                table: "RetirementOthers",
                column: "PositionLevelId",
                principalTable: "PositionLevels",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_PositionLines_PositionLineId",
                table: "RetirementOthers",
                column: "PositionLineId",
                principalTable: "PositionLines",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_PositionNumbers_PositionNumberId",
                table: "RetirementOthers",
                column: "PositionNumberId",
                principalTable: "PositionNumbers",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_PositionPathSides_PositionPathSideId",
                table: "RetirementOthers",
                column: "PositionPathSideId",
                principalTable: "PositionPathSides",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_PositionPaths_PositionPathId",
                table: "RetirementOthers",
                column: "PositionPathId",
                principalTable: "PositionPaths",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_PositionTypes_PositionTypeId",
                table: "RetirementOthers",
                column: "PositionTypeId",
                principalTable: "PositionTypes",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_Prefixes_PrefixId",
                table: "RetirementOthers",
                column: "PrefixId",
                principalTable: "Prefixes",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_Profiles_ProfileId",
                table: "RetirementOthers",
                column: "ProfileId",
                principalTable: "Profiles",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_Relationships_RelationshipId",
                table: "RetirementOthers",
                column: "RelationshipId",
                principalTable: "Relationships",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOthers_Religions_ReligionId",
                table: "RetirementOthers",
                column: "ReligionId",
                principalTable: "Religions",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RetirementOuts_Profiles_ProfileId",
                table: "RetirementOuts",
                column: "ProfileId",
                principalTable: "Profiles",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
