using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class addtablePlacementAppointment : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "PlacementAppointments", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CitizenId = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "เลขประจำตัวประชาชน") .Annotation("MySql:CharSet", "utf8mb4"), PrefixId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Firstname = table.Column(type: "longtext", nullable: false, comment: "ชื่อ") .Annotation("MySql:CharSet", "utf8mb4"), Lastname = table.Column(type: "longtext", nullable: false, comment: "นามสกุล") .Annotation("MySql:CharSet", "utf8mb4"), DateOfBirth = table.Column(type: "datetime(6)", maxLength: 40, nullable: false, comment: "วันเกิด"), GenderId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Nationality = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติ") .Annotation("MySql:CharSet", "utf8mb4"), Race = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ") .Annotation("MySql:CharSet", "utf8mb4"), ReligionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), BloodGroupId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RelationshipId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), TelephoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "เบอร์โทร") .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RecruitDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่บรรจุ"), PositionNumberId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionPathId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionPathSideId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionLineId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผลที่รับย้ายราชการ") .Annotation("MySql:CharSet", "utf8mb4"), EducationOld = table.Column(type: "longtext", nullable: true, comment: "วุฒิ/สาขาเดิม") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัดเดิม") .Annotation("MySql:CharSet", "utf8mb4"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), CommandTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionDate = table.Column(type: "datetime(6)", nullable: true, comment: "ดำรงตำแหน่งในระดับปัจจุบันเมื่อ") }, constraints: table => { table.PrimaryKey("PK_PlacementAppointments", x => x.Id); table.ForeignKey( name: "FK_PlacementAppointments_BloodGroups_BloodGroupId", column: x => x.BloodGroupId, principalTable: "BloodGroups", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_CommandTypes_CommandTypeId", column: x => x.CommandTypeId, principalTable: "CommandTypes", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_Genders_GenderId", column: x => x.GenderId, principalTable: "Genders", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_OrganizationPositions_OrganizationPosi~", column: x => x.OrganizationPositionId, principalTable: "OrganizationPositions", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_PositionLevels_PositionLevelId", column: x => x.PositionLevelId, principalTable: "PositionLevels", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_PositionLines_PositionLineId", column: x => x.PositionLineId, principalTable: "PositionLines", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_PositionNumbers_PositionNumberId", column: x => x.PositionNumberId, principalTable: "PositionNumbers", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_PositionPathSides_PositionPathSideId", column: x => x.PositionPathSideId, principalTable: "PositionPathSides", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_PositionPaths_PositionPathId", column: x => x.PositionPathId, principalTable: "PositionPaths", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_PositionTypes_PositionTypeId", column: x => x.PositionTypeId, principalTable: "PositionTypes", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_Prefixes_PrefixId", column: x => x.PrefixId, principalTable: "Prefixes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PlacementAppointments_Relationships_RelationshipId", column: x => x.RelationshipId, principalTable: "Relationships", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementAppointments_Religions_ReligionId", column: x => x.ReligionId, principalTable: "Religions", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PlacementOfficers", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Organization = table.Column(type: "longtext", nullable: true, comment: "หน่วยงานที่ช่วยราชการไป") .Annotation("MySql:CharSet", "utf8mb4"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัด") .Annotation("MySql:CharSet", "utf8mb4"), Date = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่วันที่"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน") }, constraints: table => { table.PrimaryKey("PK_PlacementOfficers", x => x.Id); table.ForeignKey( name: "FK_PlacementOfficers_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PlacementRelocations", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CitizenId = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "เลขประจำตัวประชาชน") .Annotation("MySql:CharSet", "utf8mb4"), PrefixId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Firstname = table.Column(type: "longtext", nullable: false, comment: "ชื่อ") .Annotation("MySql:CharSet", "utf8mb4"), Lastname = table.Column(type: "longtext", nullable: false, comment: "นามสกุล") .Annotation("MySql:CharSet", "utf8mb4"), DateOfBirth = table.Column(type: "datetime(6)", maxLength: 40, nullable: false, comment: "วันเกิด"), GenderId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Nationality = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติ") .Annotation("MySql:CharSet", "utf8mb4"), Race = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ") .Annotation("MySql:CharSet", "utf8mb4"), ReligionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), BloodGroupId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RelationshipId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), TelephoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "เบอร์โทร") .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RecruitDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่บรรจุ"), PositionNumberId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionPathId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionPathSideId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionLineId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PositionLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผลที่ย้ายราชการ") .Annotation("MySql:CharSet", "utf8mb4"), EducationOld = table.Column(type: "longtext", nullable: true, comment: "วุฒิ/สาขาเดิม") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัดเดิม") .Annotation("MySql:CharSet", "utf8mb4"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน") }, constraints: table => { table.PrimaryKey("PK_PlacementRelocations", x => x.Id); table.ForeignKey( name: "FK_PlacementRelocations_BloodGroups_BloodGroupId", column: x => x.BloodGroupId, principalTable: "BloodGroups", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_Genders_GenderId", column: x => x.GenderId, principalTable: "Genders", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_OrganizationPositions_OrganizationPosit~", column: x => x.OrganizationPositionId, principalTable: "OrganizationPositions", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_PositionLevels_PositionLevelId", column: x => x.PositionLevelId, principalTable: "PositionLevels", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_PositionLines_PositionLineId", column: x => x.PositionLineId, principalTable: "PositionLines", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_PositionNumbers_PositionNumberId", column: x => x.PositionNumberId, principalTable: "PositionNumbers", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_PositionPathSides_PositionPathSideId", column: x => x.PositionPathSideId, principalTable: "PositionPathSides", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_PositionPaths_PositionPathId", column: x => x.PositionPathId, principalTable: "PositionPaths", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_PositionTypes_PositionTypeId", column: x => x.PositionTypeId, principalTable: "PositionTypes", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_Prefixes_PrefixId", column: x => x.PrefixId, principalTable: "Prefixes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PlacementRelocations_Relationships_RelationshipId", column: x => x.RelationshipId, principalTable: "Relationships", principalColumn: "Id"); table.ForeignKey( name: "FK_PlacementRelocations_Religions_ReligionId", column: x => x.ReligionId, principalTable: "Religions", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PlacementRepatriations", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Organization = table.Column(type: "longtext", nullable: true, comment: "หน่วยงานที่ส่งตัวกลับไป") .Annotation("MySql:CharSet", "utf8mb4"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัด") .Annotation("MySql:CharSet", "utf8mb4"), Date = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่วันที่"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน") }, constraints: table => { table.PrimaryKey("PK_PlacementRepatriations", x => x.Id); table.ForeignKey( name: "FK_PlacementRepatriations_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementDischarges", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Organization = table.Column(type: "longtext", nullable: true, comment: "หน่วยงานที่ปลดออกไป") .Annotation("MySql:CharSet", "utf8mb4"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัด") .Annotation("MySql:CharSet", "utf8mb4"), Date = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่วันที่"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน") }, constraints: table => { table.PrimaryKey("PK_RetirementDischarges", x => x.Id); table.ForeignKey( name: "FK_RetirementDischarges_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementExpulsions", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Organization = table.Column(type: "longtext", nullable: true, comment: "หน่วยงานที่ไล่ออกไป") .Annotation("MySql:CharSet", "utf8mb4"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัด") .Annotation("MySql:CharSet", "utf8mb4"), Date = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่วันที่"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน") }, constraints: table => { table.PrimaryKey("PK_RetirementExpulsions", x => x.Id); table.ForeignKey( name: "FK_RetirementExpulsions_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementOthers", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Organization = table.Column(type: "longtext", nullable: true, comment: "หน่วยงานที่อื่นๆไป") .Annotation("MySql:CharSet", "utf8mb4"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัด") .Annotation("MySql:CharSet", "utf8mb4"), Date = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่วันที่"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), CommandTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_RetirementOthers", x => x.Id); table.ForeignKey( name: "FK_RetirementOthers_CommandTypes_CommandTypeId", column: x => x.CommandTypeId, principalTable: "CommandTypes", principalColumn: "Id"); table.ForeignKey( name: "FK_RetirementOthers_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementOuts", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Organization = table.Column(type: "longtext", nullable: true, comment: "หน่วยงานที่ให้ออกไป") .Annotation("MySql:CharSet", "utf8mb4"), Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") .Annotation("MySql:CharSet", "utf8mb4"), OrganizationPositionOld = table.Column(type: "longtext", nullable: true, comment: "สังกัด") .Annotation("MySql:CharSet", "utf8mb4"), Date = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่วันที่"), PositionTypeOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevelOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), PositionNumberOld = table.Column(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่") .Annotation("MySql:CharSet", "utf8mb4"), AmountOld = table.Column(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"), Status = table.Column(type: "longtext", nullable: false, comment: "สถานะคำขอ") .Annotation("MySql:CharSet", "utf8mb4"), IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน") }, constraints: table => { table.PrimaryKey("PK_RetirementOuts", x => x.Id); table.ForeignKey( name: "FK_RetirementOuts_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PlacementAppointmentDocs", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PlacementAppointmentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PlacementAppointmentDocs", x => x.Id); table.ForeignKey( name: "FK_PlacementAppointmentDocs_Documents_DocumentId", column: x => x.DocumentId, principalTable: "Documents", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PlacementAppointmentDocs_PlacementAppointments_PlacementAppo~", column: x => x.PlacementAppointmentId, principalTable: "PlacementAppointments", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PlacementRelocationDocs", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PlacementRelocationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PlacementRelocationDocs", x => x.Id); table.ForeignKey( name: "FK_PlacementRelocationDocs_Documents_DocumentId", column: x => x.DocumentId, principalTable: "Documents", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PlacementRelocationDocs_PlacementRelocations_PlacementReloca~", column: x => x.PlacementRelocationId, principalTable: "PlacementRelocations", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_PlacementAppointmentDocs_DocumentId", table: "PlacementAppointmentDocs", column: "DocumentId"); migrationBuilder.CreateIndex( name: "IX_PlacementAppointmentDocs_PlacementAppointmentId", table: "PlacementAppointmentDocs", column: "PlacementAppointmentId"); migrationBuilder.CreateIndex( name: "IX_PlacementAppointments_BloodGroupId", table: "PlacementAppointments", column: "BloodGroupId"); migrationBuilder.CreateIndex( name: "IX_PlacementAppointments_CommandTypeId", table: "PlacementAppointments", column: "CommandTypeId"); 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_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_RelationshipId", table: "PlacementAppointments", column: "RelationshipId"); migrationBuilder.CreateIndex( name: "IX_PlacementAppointments_ReligionId", table: "PlacementAppointments", column: "ReligionId"); migrationBuilder.CreateIndex( name: "IX_PlacementOfficers_ProfileId", table: "PlacementOfficers", column: "ProfileId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocationDocs_DocumentId", table: "PlacementRelocationDocs", column: "DocumentId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocationDocs_PlacementRelocationId", table: "PlacementRelocationDocs", column: "PlacementRelocationId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_BloodGroupId", table: "PlacementRelocations", column: "BloodGroupId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_GenderId", table: "PlacementRelocations", column: "GenderId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_OrganizationPositionId", table: "PlacementRelocations", column: "OrganizationPositionId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_PositionLevelId", table: "PlacementRelocations", column: "PositionLevelId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_PositionLineId", table: "PlacementRelocations", column: "PositionLineId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_PositionNumberId", table: "PlacementRelocations", column: "PositionNumberId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_PositionPathId", table: "PlacementRelocations", column: "PositionPathId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_PositionPathSideId", table: "PlacementRelocations", column: "PositionPathSideId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_PositionTypeId", table: "PlacementRelocations", column: "PositionTypeId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_PrefixId", table: "PlacementRelocations", column: "PrefixId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_RelationshipId", table: "PlacementRelocations", column: "RelationshipId"); migrationBuilder.CreateIndex( name: "IX_PlacementRelocations_ReligionId", table: "PlacementRelocations", column: "ReligionId"); migrationBuilder.CreateIndex( name: "IX_PlacementRepatriations_ProfileId", table: "PlacementRepatriations", column: "ProfileId"); migrationBuilder.CreateIndex( name: "IX_RetirementDischarges_ProfileId", table: "RetirementDischarges", column: "ProfileId"); migrationBuilder.CreateIndex( name: "IX_RetirementExpulsions_ProfileId", table: "RetirementExpulsions", column: "ProfileId"); migrationBuilder.CreateIndex( name: "IX_RetirementOthers_CommandTypeId", table: "RetirementOthers", column: "CommandTypeId"); migrationBuilder.CreateIndex( name: "IX_RetirementOthers_ProfileId", table: "RetirementOthers", column: "ProfileId"); migrationBuilder.CreateIndex( name: "IX_RetirementOuts_ProfileId", table: "RetirementOuts", column: "ProfileId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PlacementAppointmentDocs"); migrationBuilder.DropTable( name: "PlacementOfficers"); migrationBuilder.DropTable( name: "PlacementRelocationDocs"); migrationBuilder.DropTable( name: "PlacementRepatriations"); migrationBuilder.DropTable( name: "RetirementDischarges"); migrationBuilder.DropTable( name: "RetirementExpulsions"); migrationBuilder.DropTable( name: "RetirementOthers"); migrationBuilder.DropTable( name: "RetirementOuts"); migrationBuilder.DropTable( name: "PlacementAppointments"); migrationBuilder.DropTable( name: "PlacementRelocations"); } } }