using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb { /// public partial class addtableDisciplineReport_Profiles : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "CommandTypeId", table: "DisciplineDisciplinary_ProfileComplaintInvestigates", type: "char(36)", nullable: true, comment: "ประเภทออกคำสั่ง", collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "Status", table: "DisciplineDisciplinary_ProfileComplaintInvestigates", type: "longtext", nullable: true, comment: "สถานะออกคำสั่ง") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisciplineReport_Profiles", 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"), PersonId = table.Column(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"), CitizenId = table.Column(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน") .Annotation("MySql:CharSet", "utf8mb4"), Prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") .Annotation("MySql:CharSet", "utf8mb4"), FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ") .Annotation("MySql:CharSet", "utf8mb4"), LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล") .Annotation("MySql:CharSet", "utf8mb4"), Organization = table.Column(type: "longtext", nullable: true, comment: "สังกัด") .Annotation("MySql:CharSet", "utf8mb4"), Position = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") .Annotation("MySql:CharSet", "utf8mb4"), PosNo = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง") .Annotation("MySql:CharSet", "utf8mb4"), PositionLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับ") .Annotation("MySql:CharSet", "utf8mb4"), Salary = table.Column(type: "double", nullable: true, comment: "เงินเดือน"), Status = table.Column(type: "longtext", nullable: true, comment: "สถานะออกคำสั่ง") .Annotation("MySql:CharSet", "utf8mb4"), CommandTypeId = table.Column(type: "char(36)", nullable: true, comment: "ประเภทออกคำสั่ง", collation: "ascii_general_ci"), DescriptionSuspend = table.Column(type: "longtext", nullable: true, comment: "เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน") .Annotation("MySql:CharSet", "utf8mb4"), StartDateSuspend = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"), EndDateSuspend = table.Column(type: "datetime(6)", nullable: true, comment: "วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"), DisciplineDisciplinaryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisciplineReport_Profiles", x => x.Id); table.ForeignKey( name: "FK_DisciplineReport_Profiles_DisciplineDisciplinarys_Discipline~", column: x => x.DisciplineDisciplinaryId, principalTable: "DisciplineDisciplinarys", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_DisciplineReport_Profiles_DisciplineDisciplinaryId", table: "DisciplineReport_Profiles", column: "DisciplineDisciplinaryId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DisciplineReport_Profiles"); migrationBuilder.DropColumn( name: "CommandTypeId", table: "DisciplineDisciplinary_ProfileComplaintInvestigates"); migrationBuilder.DropColumn( name: "Status", table: "DisciplineDisciplinary_ProfileComplaintInvestigates"); } } }