using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class addtableRetirementRawProfile : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "RetirementRawProfiles", 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"), Order = table.Column(type: "int", nullable: false, comment: "ลำดับที่"), Reason = table.Column(type: "longtext", nullable: false, comment: "เหตุผล") .Annotation("MySql:CharSet", "utf8mb4"), Remove = table.Column(type: "longtext", nullable: false, comment: "ลบออกจากเกษียญ") .Annotation("MySql:CharSet", "utf8mb4"), RetirementPeriodId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), profileId = table.Column(type: "longtext", nullable: true, comment: "profile Id") .Annotation("MySql:CharSet", "utf8mb4"), prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") .Annotation("MySql:CharSet", "utf8mb4"), firstName = table.Column(type: "longtext", nullable: true, comment: "ชื่อ") .Annotation("MySql:CharSet", "utf8mb4"), lastName = table.Column(type: "longtext", nullable: true, comment: "นามสกุล") .Annotation("MySql:CharSet", "utf8mb4"), citizenId = table.Column(type: "longtext", nullable: true, comment: "เลขบัตรประชาชน") .Annotation("MySql:CharSet", "utf8mb4"), root = table.Column(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน root ") .Annotation("MySql:CharSet", "utf8mb4"), rootId = table.Column(type: "longtext", nullable: true, comment: "id หน่วยงาน root ") .Annotation("MySql:CharSet", "utf8mb4"), rootShortName = table.Column(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน root ") .Annotation("MySql:CharSet", "utf8mb4"), child1 = table.Column(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child1 ") .Annotation("MySql:CharSet", "utf8mb4"), child1Id = table.Column(type: "longtext", nullable: true, comment: "id หน่วยงาน child1 ") .Annotation("MySql:CharSet", "utf8mb4"), child1ShortName = table.Column(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child1 ") .Annotation("MySql:CharSet", "utf8mb4"), child2 = table.Column(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child2 ") .Annotation("MySql:CharSet", "utf8mb4"), child2Id = table.Column(type: "longtext", nullable: true, comment: "id หน่วยงาน child2 ") .Annotation("MySql:CharSet", "utf8mb4"), child2ShortName = table.Column(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child2 ") .Annotation("MySql:CharSet", "utf8mb4"), child3 = table.Column(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child3 ") .Annotation("MySql:CharSet", "utf8mb4"), child3Id = table.Column(type: "longtext", nullable: true, comment: "id หน่วยงาน child3 ") .Annotation("MySql:CharSet", "utf8mb4"), child3ShortName = table.Column(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child3 ") .Annotation("MySql:CharSet", "utf8mb4"), child4 = table.Column(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child4 ") .Annotation("MySql:CharSet", "utf8mb4"), child4Id = table.Column(type: "longtext", nullable: true, comment: "id หน่วยงาน child4 ") .Annotation("MySql:CharSet", "utf8mb4"), child4ShortName = table.Column(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child4 ") .Annotation("MySql:CharSet", "utf8mb4"), posMasterNo = table.Column(type: "int", nullable: true, comment: "เลขที่ตำแหน่ง "), position = table.Column(type: "longtext", nullable: true, comment: "ชื่อตำแหน่งในสายงาน ") .Annotation("MySql:CharSet", "utf8mb4"), posTypeId = table.Column(type: "longtext", nullable: true, comment: "id ประเภทตำแหน่ง ") .Annotation("MySql:CharSet", "utf8mb4"), posTypeName = table.Column(type: "longtext", nullable: true, comment: "ชื่อประเภทตำแหน่ง ") .Annotation("MySql:CharSet", "utf8mb4"), posTypeRank = table.Column(type: "int", nullable: true, comment: "ลำดับประเภทตำแหน่ง "), posLevelId = table.Column(type: "longtext", nullable: true, comment: "id ระดับตำแหน่ง ") .Annotation("MySql:CharSet", "utf8mb4"), posLevelName = table.Column(type: "longtext", nullable: true, comment: "ชื่อระดับตำแหน่ง ") .Annotation("MySql:CharSet", "utf8mb4"), posLevelRank = table.Column(type: "int", nullable: true, comment: "ลำดับระดับตำแหน่ง "), posExecutiveId = table.Column(type: "longtext", nullable: true, comment: "id ตำแหน่งทางการบริหาร ") .Annotation("MySql:CharSet", "utf8mb4"), posExecutiveName = table.Column(type: "longtext", nullable: true, comment: "ชื่อตำแหน่งทางการบริหาร ") .Annotation("MySql:CharSet", "utf8mb4"), posNo = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง ") .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_RetirementRawProfiles", x => x.Id); table.ForeignKey( name: "FK_RetirementRawProfiles_RetirementPeriods_RetirementPeriodId", column: x => x.RetirementPeriodId, principalTable: "RetirementPeriods", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_RetirementRawProfiles_RetirementPeriodId", table: "RetirementRawProfiles", column: "RetirementPeriodId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "RetirementRawProfiles"); } } }