using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class update_table_retirement_add_approver : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ApproveStep", table: "RetirementResigns", type: "longtext", nullable: true, comment: "step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "ApproveStep", table: "RetirementResignEmployees", type: "longtext", nullable: true, comment: "step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementResignApprovers", 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"), RetirementResignId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Seq = table.Column(type: "int", nullable: false), Prefix = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FirstName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), LastName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PositionName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), KeycloakId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ApproveStatus = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Comment = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ApproveType = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_RetirementResignApprovers", x => x.Id); table.ForeignKey( name: "FK_RetirementResignApprovers_RetirementResigns_RetirementResign~", column: x => x.RetirementResignId, principalTable: "RetirementResigns", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementResignCancelApprovers", 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"), RetirementResignCancelId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Seq = table.Column(type: "int", nullable: false), Prefix = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FirstName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), LastName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PositionName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), KeycloakId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ApproveStatus = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Comment = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ApproveType = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_RetirementResignCancelApprovers", x => x.Id); table.ForeignKey( name: "FK_RetirementResignCancelApprovers_RetirementResignCancels_Reti~", column: x => x.RetirementResignCancelId, principalTable: "RetirementResignCancels", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementResignEmployeeApprovers", 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"), RetirementResignEmployeeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Seq = table.Column(type: "int", nullable: false), Prefix = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FirstName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), LastName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PositionName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), KeycloakId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ApproveStatus = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Comment = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ApproveType = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_RetirementResignEmployeeApprovers", x => x.Id); table.ForeignKey( name: "FK_RetirementResignEmployeeApprovers_RetirementResignEmployees_~", column: x => x.RetirementResignEmployeeId, principalTable: "RetirementResignEmployees", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RetirementResignEmployeeCancelApprovers", 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"), RetirementResignEmployeeCancelId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Seq = table.Column(type: "int", nullable: false), Prefix = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FirstName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), LastName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PositionName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), KeycloakId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ApproveStatus = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Comment = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ApproveType = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_RetirementResignEmployeeCancelApprovers", x => x.Id); table.ForeignKey( name: "FK_RetirementResignEmployeeCancelApprovers_RetirementResignEmpl~", column: x => x.RetirementResignEmployeeCancelId, principalTable: "RetirementResignEmployeeCancels", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_RetirementResignApprovers_RetirementResignId", table: "RetirementResignApprovers", column: "RetirementResignId"); migrationBuilder.CreateIndex( name: "IX_RetirementResignCancelApprovers_RetirementResignCancelId", table: "RetirementResignCancelApprovers", column: "RetirementResignCancelId"); migrationBuilder.CreateIndex( name: "IX_RetirementResignEmployeeApprovers_RetirementResignEmployeeId", table: "RetirementResignEmployeeApprovers", column: "RetirementResignEmployeeId"); migrationBuilder.CreateIndex( name: "IX_RetirementResignEmployeeCancelApprovers_RetirementResignEmpl~", table: "RetirementResignEmployeeCancelApprovers", column: "RetirementResignEmployeeCancelId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "RetirementResignApprovers"); migrationBuilder.DropTable( name: "RetirementResignCancelApprovers"); migrationBuilder.DropTable( name: "RetirementResignEmployeeApprovers"); migrationBuilder.DropTable( name: "RetirementResignEmployeeCancelApprovers"); migrationBuilder.DropColumn( name: "ApproveStep", table: "RetirementResigns"); migrationBuilder.DropColumn( name: "ApproveStep", table: "RetirementResignEmployees"); } } }