using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class updatetableRetirementResignsaddchild : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_RetirementResigns_Profiles_ProfileId", table: "RetirementResigns"); migrationBuilder.DropIndex( name: "IX_RetirementResigns_ProfileId", table: "RetirementResigns"); migrationBuilder.RenameColumn( name: "ProfileId", table: "RetirementResigns", newName: "profileId"); migrationBuilder.AlterColumn( name: "profileId", table: "RetirementResigns", 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( name: "OrganizationOld", table: "RetirementResigns", type: "longtext", nullable: true, comment: "สังกัดเดิม") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "PositionOld", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ตำแหน่งเดิม") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child1", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child1") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child1Id", table: "RetirementResigns", type: "longtext", nullable: true, comment: "id หน่วยงาน child1") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child1ShortName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child1") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child2", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child2") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child2Id", table: "RetirementResigns", type: "longtext", nullable: true, comment: "id หน่วยงาน child2") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child2ShortName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child2") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child3", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child3") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child3Id", table: "RetirementResigns", type: "longtext", nullable: true, comment: "id หน่วยงาน child3") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child3ShortName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child3") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child4", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child4") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child4Id", table: "RetirementResigns", type: "longtext", nullable: true, comment: "id หน่วยงาน child4") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "child4ShortName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child4") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "citizenId", table: "RetirementResigns", type: "longtext", nullable: true, comment: "เลขบัตรประชาชน") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "firstName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "lastName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "นามสกุล") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "posLevelId", table: "RetirementResigns", type: "longtext", nullable: true, comment: "id ระดับตำแหน่ง") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "posLevelName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อระดับตำแหน่ง") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "posMasterNo", table: "RetirementResigns", type: "int", nullable: true, comment: "เลขที่ตำแหน่ง"); migrationBuilder.AddColumn( name: "posTypeId", table: "RetirementResigns", type: "longtext", nullable: true, comment: "id ประเภทตำแหน่ง") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "posTypeName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อประเภทตำแหน่ง") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "position", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อตำแหน่งในสายงาน") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "prefix", table: "RetirementResigns", type: "longtext", nullable: true, comment: "คำนำหน้า") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "root", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน root") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "rootId", table: "RetirementResigns", type: "longtext", nullable: true, comment: "id หน่วยงาน root") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "rootShortName", table: "RetirementResigns", type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน root") .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "OrganizationOld", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "PositionOld", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child1", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child1Id", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child1ShortName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child2", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child2Id", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child2ShortName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child3", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child3Id", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child3ShortName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child4", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child4Id", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "child4ShortName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "citizenId", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "firstName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "lastName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "posLevelId", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "posLevelName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "posMasterNo", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "posTypeId", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "posTypeName", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "position", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "prefix", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "root", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "rootId", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "rootShortName", table: "RetirementResigns"); migrationBuilder.RenameColumn( name: "profileId", table: "RetirementResigns", newName: "ProfileId"); migrationBuilder.AlterColumn( name: "ProfileId", table: "RetirementResigns", 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.CreateIndex( name: "IX_RetirementResigns_ProfileId", table: "RetirementResigns", column: "ProfileId"); migrationBuilder.AddForeignKey( name: "FK_RetirementResigns_Profiles_ProfileId", table: "RetirementResigns", column: "ProfileId", principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }