diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs index ed63d87b..50826596 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs @@ -194,38 +194,38 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers data.LastUpdateFullName = FullName ?? "System Administrator"; data.LastUpdateUserId = UserId ?? ""; data.LastUpdatedAt = DateTime.Now; - var hisprofile = data.DisciplineDisciplinary_ProfileComplaintInvestigates; - _context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates); - if (data.RespondentType.Trim().ToUpper() == "PERSON") - { - foreach (var item in req.persons) - { - var isReport = hisprofile.Where(x => x.PersonId == item.personId).FirstOrDefault(); - data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add( - new DisciplineDisciplinary_ProfileComplaintInvestigate - { - CitizenId = item.idcard, - Prefix = item.prefix, - FirstName = item.firstName, - LastName = item.lastName, - Organization = item.organization, - Position = item.position, - PositionLevel = item.positionLevel, - Salary = item.salary, - PersonId = item.personId, - PosNo = item.posNo, - Status = "NEW", - IsReport = isReport == null ? false : isReport.IsReport, - CreatedFullName = FullName ?? "System Administrator", - CreatedUserId = UserId ?? "", - CreatedAt = DateTime.Now, - LastUpdateFullName = FullName ?? "System Administrator", - LastUpdateUserId = UserId ?? "", - LastUpdatedAt = DateTime.Now, - } - ); - } - } + // var hisprofile = data.DisciplineDisciplinary_ProfileComplaintInvestigates; + // _context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates); + // if (data.RespondentType.Trim().ToUpper() == "PERSON") + // { + // foreach (var item in req.persons) + // { + // var isReport = hisprofile.Where(x => x.PersonId == item.personId).FirstOrDefault(); + // data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add( + // new DisciplineDisciplinary_ProfileComplaintInvestigate + // { + // CitizenId = item.idcard, + // Prefix = item.prefix, + // FirstName = item.firstName, + // LastName = item.lastName, + // Organization = item.organization, + // Position = item.position, + // PositionLevel = item.positionLevel, + // Salary = item.salary, + // PersonId = item.personId, + // PosNo = item.posNo, + // Status = "NEW", + // IsReport = isReport == null ? false : isReport.IsReport, + // CreatedFullName = FullName ?? "System Administrator", + // CreatedUserId = UserId ?? "", + // CreatedAt = DateTime.Now, + // LastUpdateFullName = FullName ?? "System Administrator", + // LastUpdateUserId = UserId ?? "", + // LastUpdatedAt = DateTime.Now, + // } + // ); + // } + // } await _context.SaveChangesAsync(); return Success(data.Id); } @@ -459,6 +459,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers PosNo = p.PosNo, Organization = p.Organization, IsSend = p.IsReport, + Status = p.Status, + StatusDiscard = p.StatusDiscard, Report = p.DisciplineReport_Profiles.Count() > 0 ? true : false, }),//รายการข้อมูลบุคลผู้ถูกสืบสวน OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน @@ -676,7 +678,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers Salary = item.salary, PersonId = item.personId, PosNo = item.posNo, - Status = "NEW", + Status = isReport == null ? "NEW" : isReport.Status, + StatusDiscard = isReport == null ? "NEW" : isReport.StatusDiscard, IsReport = isReport == null ? false : isReport.IsReport, CreatedFullName = FullName ?? "System Administrator", CreatedUserId = UserId ?? "", @@ -1460,8 +1463,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน - [HttpPut("suspend/{id:length(36)}")] - public async Task> PostToSuspend([FromBody] DisciplinePersonIdRequest req, Guid id) + [HttpPut("suspend/{id:length(36)}/{commandTypeId:length(36)}")] + public async Task> PostToSuspend([FromBody] DisciplinePersonIdRequest req, Guid id, Guid commandTypeId) { var data = await _context.DisciplineDisciplinarys .Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates) @@ -1474,7 +1477,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers var persons = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => req.persons.Contains(x.Id)).ToList(); foreach (var item in persons) { - var personIdDupicate = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.PersonId == item.PersonId).FirstOrDefault(); + var personIdDupicate = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.PersonId == item.PersonId && x.Status == "NEW").FirstOrDefault(); if (personIdDupicate == null) continue; if (personIdDupicate.DisciplineReport_Profiles.Count() > 0) @@ -1500,7 +1503,43 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers LastUpdateUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, }); - item.Status = "SUSPEND"; + item.CommandTypeId = commandTypeId; + item.Status = "REPORT"; + item.LastUpdateFullName = FullName ?? "System Administrator"; + item.LastUpdateUserId = UserId ?? ""; + item.LastUpdatedAt = DateTime.Now; + } + + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// สั่งรายชื่อไปออกคำสั่งงดโทษ + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("discard/{id:length(36)}/{commandTypeId:length(36)}")] + public async Task> PostToDiscard([FromBody] DisciplinePersonIdRequest req, Guid id, Guid commandTypeId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound); + + var persons = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => req.persons.Contains(x.Id)).ToList(); + foreach (var item in persons) + { + var personIdDupicate = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.PersonId == item.PersonId && x.Status == "REPORT" && x.StatusDiscard == "NEW").FirstOrDefault(); + if (personIdDupicate == null) + continue; + item.CommandTypeDiscardId = commandTypeId; + item.StatusDiscard = "REPORT"; item.LastUpdateFullName = FullName ?? "System Administrator"; item.LastUpdateUserId = UserId ?? ""; item.LastUpdatedAt = DateTime.Now; diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs index 0eab6d3c..a1fc41a2 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs @@ -571,6 +571,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers Position = item.Position, PositionLevel = item.PositionLevel, Status = "NEW", + StatusDiscard = "NEW", IsReport = false, CreatedFullName = FullName ?? "System Administrator", CreatedUserId = UserId ?? "", diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_ProfileComplaintInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_ProfileComplaintInvestigate.cs index d239a84c..56abfc83 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_ProfileComplaintInvestigate.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_ProfileComplaintInvestigate.cs @@ -33,6 +33,10 @@ namespace BMA.EHR.Domain.Models.Discipline public string? Status { get; set; } [Comment("ประเภทออกคำสั่ง")] public Guid? CommandTypeId { get; set; } + [Comment("สถานะออกคำสั่งงดโทด")] + public string? StatusDiscard { get; set; } + [Comment("ประเภทออกคำสั่งงดโทด")] + public Guid? CommandTypeDiscardId { get; set; } [Comment("ส่งไปยุติเรื่อง")] public bool IsReport { get; set; } = false; [Required, Comment("Id เรื่องสอบสวน")] diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.Designer.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.Designer.cs new file mode 100644 index 00000000..08dec4a1 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.Designer.cs @@ -0,0 +1,2964 @@ +// +using System; +using BMA.EHR.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + [DbContext(typeof(DisciplineDbContext))] + [Migration("20231219171600_delete tavle metadata")] + partial class deletetavlemetadata + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CaseNumber") + .HasColumnType("longtext") + .HasComment("คดีเลขที่"); + + b.Property("CaseType") + .HasColumnType("longtext") + .HasComment("ประเภทคดี"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์"); + + b.Property("Fullname") + .HasColumnType("longtext") + .HasComment("ชื่อ-นามสกุลผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัดผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่งผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("ProfileId") + .HasColumnType("char(36)") + .HasComment("ProfileId"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะอุทธรณ์/ร้องทุกข์"); + + b.Property("Title") + .HasColumnType("text") + .HasComment("เรื่องที่อุทธรณ์/ร้องทุกข์"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ประเภทอุทธรณ์หรือร้องทุกข์"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Appeals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaint_AppealId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineComplaint_Appeal_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_History", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะอุทธรณ์/ร้องทุกข์"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaint_AppealId"); + + b.ToTable("DisciplineComplaint_Appeal_Historys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Channel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อประเภทการร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Channels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineComplaint_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineComplaint_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Email") + .IsRequired() + .HasColumnType("longtext") + .HasComment("อีเมล"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เบอร์โทรศัพท์"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("Prefix") + .IsRequired() + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineDirectors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("longtext") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryCauseText") + .HasColumnType("longtext") + .HasComment("ผลการสอบสวน กรณีมีมูล"); + + b.Property("DisciplinaryDateAllegation") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับทราบข้อกล่าวหา"); + + b.Property("DisciplinaryDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("DisciplinaryDateEvident") + .HasColumnType("datetime(6)") + .HasComment("วันที่สรุปพยานหลักฐาน"); + + b.Property("DisciplinaryDateInvestigation") + .HasColumnType("datetime(6)") + .HasComment("วันที่มีคำสั่งให้สอบสวน"); + + b.Property("DisciplinaryDateResult") + .HasColumnType("datetime(6)") + .HasComment("วันที่รายงานผลการสอบสวน"); + + b.Property("DisciplinaryDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("DisciplinaryDaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่ขยาย"); + + b.Property("DisciplinaryExtendStatus") + .HasColumnType("tinyint(1)") + .HasComment("ขยายเวลา"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("longtext") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplinaryInvestigateAt") + .HasColumnType("longtext") + .HasComment("สอบสวนที่"); + + b.Property("DisciplinaryRecordAccuser") + .HasColumnType("longtext") + .HasComment("บันทึกถ้อยคำของผู้กล่าวหา"); + + b.Property("DisciplinaryRefLaw") + .HasColumnType("longtext") + .HasComment("อ้างอิงมาตราตามกฎหมาย"); + + b.Property("DisciplinaryResult") + .HasColumnType("longtext") + .HasComment("ผลการสอบสวน เหตุผล"); + + b.Property("DisciplinaryStatusResult") + .HasColumnType("longtext") + .HasComment("ผลการสอบสวน ผล"); + + b.Property("DisciplinarySummaryEvidence") + .HasColumnType("longtext") + .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"); + + b.Property("DisciplinaryWitnesses") + .HasColumnType("longtext") + .HasComment("พยานและบันทึกถ้อยคำพยาน"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("tinyint(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("ResultDescription") + .HasColumnType("longtext") + .HasComment("สรุปผลการพิจารณา"); + + b.Property("ResultDisciplineType") + .HasColumnType("longtext") + .HasComment("ประเภทวินัย"); + + b.Property("ResultInvestigate") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องสืบสวน"); + + b.Property("ResultOc") + .HasColumnType("longtext") + .HasComment("หน่วยงาย/ส่วนราชการ"); + + b.Property("ResultTitleType") + .HasColumnType("longtext") + .HasComment("ประเภทของเรื่อง"); + + b.Property("ResultYear") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("int") + .HasComment("ครั้งที่ขยาย"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinaryExtends"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_DirectorInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigateRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocOthers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRecordAccusers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocResults"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocSummaryEvidences"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocWitnessess"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeId") + .HasColumnType("char(36)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("IsReport") + .HasColumnType("tinyint(1)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะออกคำสั่ง"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("tinyint(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("int") + .HasComment("ครั้งที่ขยาย"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigateExtends"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigateRelevant_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_DocComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("IsReport") + .HasColumnType("tinyint(1)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeId") + .HasColumnType("char(36)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DescriptionSuspend") + .HasColumnType("longtext") + .HasComment("เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน"); + + b.Property("DisciplineDisciplinary_ProfileComplaintInvestigateId") + .HasColumnType("char(36)"); + + b.Property("EndDateSuspend") + .HasColumnType("datetime(6)") + .HasComment("วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.Property("StartDateSuspend") + .HasColumnType("datetime(6)") + .HasComment("วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะออกคำสั่ง"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinary_ProfileComplaintInvestigateId"); + + b.ToTable("DisciplineReport_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("text"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ObjectRefId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("Documents"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal") + .WithMany("DisciplineComplaint_Appeal_Docs") + .HasForeignKey("DisciplineComplaint_AppealId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint_Appeal"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_History", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal") + .WithMany("DisciplineComplaint_Appeal_Historys") + .HasForeignKey("DisciplineComplaint_AppealId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint_Appeal"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Docs") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Profiles") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineDisciplinarys") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinaryExtends") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigateRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocOthers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRecordAccusers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocResults") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocSummaryEvidences") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocWitnessess") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_ProfileComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineInvestigates") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateExtends") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", "DisciplineDisciplinary_ProfileComplaintInvestigate") + .WithMany("DisciplineReport_Profiles") + .HasForeignKey("DisciplineDisciplinary_ProfileComplaintInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Navigation("DisciplineComplaint_Docs"); + + b.Navigation("DisciplineComplaint_Profiles"); + + b.Navigation("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b => + { + b.Navigation("DisciplineComplaint_Appeal_Docs"); + + b.Navigation("DisciplineComplaint_Appeal_Historys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => + { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineDisciplinaryExtends"); + + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocInvestigateRelevants"); + + b.Navigation("DisciplineDisciplinary_DocInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocOthers"); + + b.Navigation("DisciplineDisciplinary_DocRecordAccusers"); + + b.Navigation("DisciplineDisciplinary_DocRelevants"); + + b.Navigation("DisciplineDisciplinary_DocResults"); + + b.Navigation("DisciplineDisciplinary_DocSummaryEvidences"); + + b.Navigation("DisciplineDisciplinary_DocWitnessess"); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Navigation("DisciplineReport_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Navigation("DisciplineDisciplinarys"); + + b.Navigation("DisciplineInvestigateExtends"); + + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.cs new file mode 100644 index 00000000..b0e24c29 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.cs @@ -0,0 +1,4374 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + /// + public partial class deletetavlemetadata : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AvailablePositionLevels"); + + migrationBuilder.DropTable( + name: "BloodGroups"); + + migrationBuilder.DropTable( + name: "EducationLevels"); + + migrationBuilder.DropTable( + name: "Holidays"); + + migrationBuilder.DropTable( + name: "LimitTypeLeave"); + + migrationBuilder.DropTable( + name: "OrganizationAgencys"); + + migrationBuilder.DropTable( + name: "OrganizationGovernmentAgencys"); + + migrationBuilder.DropTable( + name: "PhysicalStatuses"); + + migrationBuilder.DropTable( + name: "PositionEmployeeStatuses"); + + migrationBuilder.DropTable( + name: "PositionMasterHistoryEntity"); + + migrationBuilder.DropTable( + name: "Positions"); + + migrationBuilder.DropTable( + name: "ProfileAbilityHistory"); + + migrationBuilder.DropTable( + name: "ProfileAddressHistory"); + + migrationBuilder.DropTable( + name: "ProfileAssessmentHistory"); + + migrationBuilder.DropTable( + name: "ProfileAvatarHistory"); + + migrationBuilder.DropTable( + name: "ProfileCertificateHistory"); + + migrationBuilder.DropTable( + name: "ProfileChangeNameHistory"); + + migrationBuilder.DropTable( + name: "ProfileChildrenHistory"); + + migrationBuilder.DropTable( + name: "ProfileCoupleHistory"); + + migrationBuilder.DropTable( + name: "ProfileCurrentAddressHistory"); + + migrationBuilder.DropTable( + name: "ProfileDisciplineHistory"); + + migrationBuilder.DropTable( + name: "ProfileDutyHistory"); + + migrationBuilder.DropTable( + name: "ProfileEducationHistory"); + + migrationBuilder.DropTable( + name: "ProfileEmployment"); + + migrationBuilder.DropTable( + name: "ProfileFatherHistory"); + + migrationBuilder.DropTable( + name: "ProfileGovernmentHistory"); + + migrationBuilder.DropTable( + name: "ProfileHistory"); + + migrationBuilder.DropTable( + name: "ProfileHonorHistory"); + + migrationBuilder.DropTable( + name: "ProfileInsigniaHistory"); + + migrationBuilder.DropTable( + name: "ProfileLeaveHistory"); + + migrationBuilder.DropTable( + name: "ProfileMotherHistory"); + + migrationBuilder.DropTable( + name: "ProfileNopaidHistory"); + + migrationBuilder.DropTable( + name: "ProfileOtherHistory"); + + migrationBuilder.DropTable( + name: "ProfilePaper"); + + migrationBuilder.DropTable( + name: "ProfilePositions"); + + migrationBuilder.DropTable( + name: "ProfileRegistrationAddressHistory"); + + migrationBuilder.DropTable( + name: "ProfileSalaryHistory"); + + migrationBuilder.DropTable( + name: "ProfileTrainingHistory"); + + migrationBuilder.DropTable( + name: "Relationships"); + + migrationBuilder.DropTable( + name: "Religions"); + + migrationBuilder.DropTable( + name: "RoyalHierarchys"); + + migrationBuilder.DropTable( + name: "Royals"); + + migrationBuilder.DropTable( + name: "RoyalTypes"); + + migrationBuilder.DropTable( + name: "SubDistricts"); + + migrationBuilder.DropTable( + name: "ProfileAbility"); + + migrationBuilder.DropTable( + name: "ProfileAssessment"); + + migrationBuilder.DropTable( + name: "ProfileCertificate"); + + migrationBuilder.DropTable( + name: "ProfileChangeName"); + + migrationBuilder.DropTable( + name: "ProfileChildren"); + + migrationBuilder.DropTable( + name: "ProfileFamilyHistory"); + + migrationBuilder.DropTable( + name: "ProfileDiscipline"); + + migrationBuilder.DropTable( + name: "ProfileDuty"); + + migrationBuilder.DropTable( + name: "ProfileEducation"); + + migrationBuilder.DropTable( + name: "ProfileHonor"); + + migrationBuilder.DropTable( + name: "ProfileInsignia"); + + migrationBuilder.DropTable( + name: "ProfileLeave"); + + migrationBuilder.DropTable( + name: "ProfileNopaid"); + + migrationBuilder.DropTable( + name: "ProfileOther"); + + migrationBuilder.DropTable( + name: "OrganizationPositions"); + + migrationBuilder.DropTable( + name: "ProfileSalary"); + + migrationBuilder.DropTable( + name: "ProfileTraining"); + + migrationBuilder.DropTable( + name: "Districts"); + + migrationBuilder.DropTable( + name: "Insignias"); + + migrationBuilder.DropTable( + name: "TypeLeave"); + + migrationBuilder.DropTable( + name: "Organizations"); + + migrationBuilder.DropTable( + name: "PositionMasters"); + + migrationBuilder.DropTable( + name: "Profile"); + + migrationBuilder.DropTable( + name: "Provinces"); + + migrationBuilder.DropTable( + name: "InsigniaTypes"); + + migrationBuilder.DropTable( + name: "OrganizationFaxs"); + + migrationBuilder.DropTable( + name: "OrganizationLevels"); + + migrationBuilder.DropTable( + name: "OrganizationOrganizations"); + + migrationBuilder.DropTable( + name: "OrganizationStatuses"); + + migrationBuilder.DropTable( + name: "OrganizationTelExternals"); + + migrationBuilder.DropTable( + name: "OrganizationTelInternals"); + + migrationBuilder.DropTable( + name: "OrganizationTypes"); + + migrationBuilder.DropTable( + name: "PositionExecutiveSides"); + + migrationBuilder.DropTable( + name: "PositionExecutives"); + + migrationBuilder.DropTable( + name: "PositionLines"); + + migrationBuilder.DropTable( + name: "PositionPathSides"); + + migrationBuilder.DropTable( + name: "PositionStatuss"); + + migrationBuilder.DropTable( + name: "Document"); + + migrationBuilder.DropTable( + name: "Genders"); + + migrationBuilder.DropTable( + name: "LimitLeave"); + + migrationBuilder.DropTable( + name: "PositionEmployeeGroups"); + + migrationBuilder.DropTable( + name: "PositionEmployeeLevels"); + + migrationBuilder.DropTable( + name: "PositionEmployeeLines"); + + migrationBuilder.DropTable( + name: "PositionEmployeePositionSides"); + + migrationBuilder.DropTable( + name: "PositionEmployeePositions"); + + migrationBuilder.DropTable( + name: "PositionLevels"); + + migrationBuilder.DropTable( + name: "PositionNumbers"); + + migrationBuilder.DropTable( + name: "PositionPaths"); + + migrationBuilder.DropTable( + name: "PositionTypes"); + + migrationBuilder.DropTable( + name: "Prefixes"); + + migrationBuilder.DropTable( + name: "OrganizationShortNames"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "BloodGroups", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(2)", maxLength: 2, nullable: false, comment: "ชื่อหมู่โลหิต") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_BloodGroups", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Document", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CreatedDate = table.Column(type: "datetime(6)", nullable: false), + Detail = table.Column(type: "text", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + FileName = table.Column(type: "varchar(255)", maxLength: 255, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + FileSize = table.Column(type: "int", nullable: false), + FileType = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ObjectRefId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_Document", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "EducationLevels", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ระดับการศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_EducationLevels", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Genders", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "เพศ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_Genders", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Holidays", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Year = table.Column(type: "int", nullable: false, comment: "ประจำปี"), + HolidayDate = table.Column(type: "datetime(6)", nullable: false, comment: "วันหยุด"), + OriginalDate = table.Column(type: "datetime(6)", nullable: false, comment: "วันหยุด(Original)"), + Name = table.Column(type: "varchar(250)", maxLength: 250, nullable: false, comment: "ชื่อวันหยุด") + .Annotation("MySql:CharSet", "utf8mb4"), + IsSpecial = table.Column(type: "tinyint(1)", nullable: false, comment: "เป็นวันหยุดพิเศษหรือไม่"), + Category = table.Column(type: "longtext", nullable: false, comment: "ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_Holidays", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "InsigniaTypes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "ชื่อประเภทเครื่องราช") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_InsigniaTypes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "LimitLeave", + 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"), + Name = table.Column(type: "longtext", nullable: true, comment: "ยังไม่ชัวใช้อะไรเป็นkey") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_LimitLeave", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationAgencys", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงานต้นสังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationAgencys", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationFaxs", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์โทรสาร") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationFaxs", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationGovernmentAgencys", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ ส่วนราชการต้นสังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationGovernmentAgencys", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationLevels", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ ระดับ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationLevels", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationOrganizations", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationOrganizations", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationShortNames", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + AgencyCode = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสหน่วยงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + GovernmentCode = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ") + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationShortNames", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationStatuses", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ สถานะ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationStatuses", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationTelExternals", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายนอก") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationTelExternals", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationTelInternals", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายใน") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationTelInternals", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationTypes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ข้อมูลโครงสร้างหน่วยงานชื่อ ประเภท") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationTypes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PhysicalStatuses", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "สถานภาพทางกาย") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PhysicalStatuses", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionEmployeeGroups", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อกลุ่มงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionEmployeeGroups", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionEmployeeLevels", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Order = table.Column(type: "int", nullable: true, comment: "ลำดับ"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionEmployeeLevels", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionEmployeeLines", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อสายงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionEmployeeLines", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionEmployeePositions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionEmployeePositions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionEmployeePositionSides", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อด้านของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionEmployeePositionSides", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionEmployeeStatuses", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อสถานะของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionEmployeeStatuses", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionExecutives", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อตำแหน่งทางการบริหารของข้อมูลตำแหน่งของข้าราชการ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionExecutives", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionExecutiveSides", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อด้านทางการบริหาร") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionExecutiveSides", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionLevels", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Order = table.Column(type: "int", nullable: true, comment: "ลำดับ"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อระดับตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + ShortName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อย่อระดับตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + Level = table.Column(type: "int", nullable: false, comment: "ลำดับชั้นของระดับตำแหน่ง"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionLevels", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionLines", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อสายงานของข้อมูลตำแหน่งของข้าราชการ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionLines", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionPaths", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อสายงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionPaths", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionPathSides", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อด้าน/สาขา") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionPathSides", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionStatuss", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อสถานะของตำแหน่งของข้อมูลตำแหน่งของข้าราชการ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionStatuss", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionTypes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Order = table.Column(type: "int", nullable: true, comment: "ลำดับ"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อประเภทตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionTypes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Prefixes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "รายละเอียดคำนำหน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_Prefixes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Provinces", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(150)", maxLength: 150, nullable: false, comment: "จังหวัด") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_Provinces", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Relationships", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "ชื่อความสัมพันธ์") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_Relationships", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Religions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ศาสนา") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_Religions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "RoyalHierarchys", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อลำดับชั้นข้อมูลเครื่องราชฯ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_RoyalHierarchys", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Royals", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อประเภทข้อมูลเหรียญตรา") + .Annotation("MySql:CharSet", "utf8mb4"), + ShortName = table.Column(type: "varchar(10)", maxLength: 10, nullable: false, comment: "ชื่อย่อเหรียญตรา") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_Royals", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "RoyalTypes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อประเภทข้อมูลเครื่องราชฯ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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") + }, + constraints: table => + { + table.PrimaryKey("PK_RoyalTypes", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TypeLeave", + 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"), + Name = table.Column(type: "longtext", nullable: true, comment: "ประเภทการลา") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_TypeLeave", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Insignias", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อเครื่องราช") + .Annotation("MySql:CharSet", "utf8mb4"), + ShortName = table.Column(type: "varchar(30)", maxLength: 30, nullable: false, comment: "ชื่อย่อเครื่องราช") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + Level = table.Column(type: "int", nullable: false, comment: "ลำดับชั้นของเครื่องราช เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น"), + Note = table.Column(type: "longtext", nullable: false, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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"), + InsigniaTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_Insignias", x => x.Id); + table.ForeignKey( + name: "FK_Insignias_InsigniaTypes_InsigniaTypeId", + column: x => x.InsigniaTypeId, + principalTable: "InsigniaTypes", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionNumbers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(300)", maxLength: 300, nullable: true, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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"), + OrganizationShortNameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionNumbers", x => x.Id); + table.ForeignKey( + name: "FK_PositionNumbers_OrganizationShortNames_OrganizationShortName~", + column: x => x.OrganizationShortNameId, + principalTable: "OrganizationShortNames", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Organizations", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + OrganizationAgencyId = table.Column(type: "char(36)", nullable: true, comment: "OrganizationAgencyId", collation: "ascii_general_ci"), + OrganizationGovernmentAgencyId = table.Column(type: "char(36)", nullable: true, comment: "OrganizationGovernmentAgencyId", collation: "ascii_general_ci"), + OrganizationOrder = table.Column(type: "int", nullable: true, comment: "OrganizationOrder"), + OrganizationUserNote = table.Column(type: "longtext", nullable: true, comment: "OrganizationUserNote") + .Annotation("MySql:CharSet", "utf8mb4"), + Agency = table.Column(type: "longtext", nullable: true, comment: "หน่วยงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + Government = table.Column(type: "longtext", nullable: true, comment: "ส่วนราชการ") + .Annotation("MySql:CharSet", "utf8mb4"), + Department = table.Column(type: "longtext", nullable: true, comment: "ฝ่าย/ส่วน") + .Annotation("MySql:CharSet", "utf8mb4"), + Pile = table.Column(type: "longtext", nullable: true, comment: "กอง") + .Annotation("MySql:CharSet", "utf8mb4"), + 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"), + OrganizationFaxId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationOrganizationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationShortNameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationStatusId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationTelExternalId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationTelInternalId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน") + }, + constraints: table => + { + table.PrimaryKey("PK_Organizations", x => x.Id); + table.ForeignKey( + name: "FK_Organizations_OrganizationFaxs_OrganizationFaxId", + column: x => x.OrganizationFaxId, + principalTable: "OrganizationFaxs", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_OrganizationLevels_OrganizationLevelId", + column: x => x.OrganizationLevelId, + principalTable: "OrganizationLevels", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_OrganizationOrganizations_OrganizationOrganiza~", + column: x => x.OrganizationOrganizationId, + principalTable: "OrganizationOrganizations", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_OrganizationShortNames_OrganizationShortNameId", + column: x => x.OrganizationShortNameId, + principalTable: "OrganizationShortNames", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_OrganizationStatuses_OrganizationStatusId", + column: x => x.OrganizationStatusId, + principalTable: "OrganizationStatuses", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_OrganizationTelExternals_OrganizationTelExtern~", + column: x => x.OrganizationTelExternalId, + principalTable: "OrganizationTelExternals", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_OrganizationTelInternals_OrganizationTelIntern~", + column: x => x.OrganizationTelInternalId, + principalTable: "OrganizationTelInternals", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_OrganizationTypes_OrganizationTypeId", + column: x => x.OrganizationTypeId, + principalTable: "OrganizationTypes", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Organizations_Organizations_ParentId", + column: x => x.ParentId, + principalTable: "Organizations", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionMasters", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + PositionId = table.Column(type: "char(36)", nullable: true, comment: "PositionId", collation: "ascii_general_ci"), + PositionCondition = table.Column(type: "longtext", nullable: true, comment: "PositionCondition") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionMasterUserNote = table.Column(type: "longtext", nullable: true, comment: "PositionMasterUserNote") + .Annotation("MySql:CharSet", "utf8mb4"), + IsDirector = table.Column(type: "tinyint(1)", nullable: true, comment: "IsDirector"), + Qualification = table.Column(type: "longtext", nullable: true, comment: "คุณวุฒิ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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"), + PositionExecutiveId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionExecutiveSideId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionLineId = 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"), + PositionStatusId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionExecutiveSideObject = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPathSideObject = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionMasters", x => x.Id); + table.ForeignKey( + name: "FK_PositionMasters_PositionExecutiveSides_PositionExecutiveSide~", + column: x => x.PositionExecutiveSideId, + principalTable: "PositionExecutiveSides", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_PositionMasters_PositionExecutives_PositionExecutiveId", + column: x => x.PositionExecutiveId, + principalTable: "PositionExecutives", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_PositionMasters_PositionLines_PositionLineId", + column: x => x.PositionLineId, + principalTable: "PositionLines", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_PositionMasters_PositionPathSides_PositionPathSideId", + column: x => x.PositionPathSideId, + principalTable: "PositionPathSides", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_PositionMasters_PositionPaths_PositionPathId", + column: x => x.PositionPathId, + principalTable: "PositionPaths", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_PositionMasters_PositionStatuss_PositionStatusId", + column: x => x.PositionStatusId, + principalTable: "PositionStatuss", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_PositionMasters_PositionTypes_PositionTypeId", + column: x => x.PositionTypeId, + principalTable: "PositionTypes", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Positions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(300)", maxLength: 300, nullable: false, comment: "ชื่อตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + ExecutiveName = table.Column(type: "varchar(300)", maxLength: 300, nullable: false, comment: "ชื่อตำแหน่งทางการบริหาร") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionCategory = table.Column(type: "longtext", nullable: false, comment: "ตำแหน่งสำหรับข้าราชการหรือลูกจ้าง officer/employee") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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"), + ExecutiveSideId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PathSideId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionPathId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_Positions", x => x.Id); + table.ForeignKey( + name: "FK_Positions_PositionExecutiveSides_ExecutiveSideId", + column: x => x.ExecutiveSideId, + principalTable: "PositionExecutiveSides", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Positions_PositionLevels_PositionLevelId", + column: x => x.PositionLevelId, + principalTable: "PositionLevels", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Positions_PositionPathSides_PathSideId", + column: x => x.PathSideId, + principalTable: "PositionPathSides", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Positions_PositionPaths_PositionPathId", + column: x => x.PositionPathId, + principalTable: "PositionPaths", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Positions_PositionTypes_PositionTypeId", + column: x => x.PositionTypeId, + principalTable: "PositionTypes", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Districts", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(150)", maxLength: 150, nullable: false, comment: "เขต/อำเภอ") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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"), + ProvinceId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_Districts", x => x.Id); + table.ForeignKey( + name: "FK_Districts_Provinces_ProvinceId", + column: x => x.ProvinceId, + principalTable: "Provinces", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "LimitTypeLeave", + 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"), + LimitLeaveId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TypeLeaveId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + NumLeave = table.Column(type: "double", nullable: true, comment: "จำนวนที่ลาได้") + }, + constraints: table => + { + table.PrimaryKey("PK_LimitTypeLeave", x => x.Id); + table.ForeignKey( + name: "FK_LimitTypeLeave_LimitLeave_LimitLeaveId", + column: x => x.LimitLeaveId, + principalTable: "LimitLeave", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_LimitTypeLeave_TypeLeave_TypeLeaveId", + column: x => x.TypeLeaveId, + principalTable: "TypeLeave", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Profile", + 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"), + AvatarId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + GenderId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LimitLeaveId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionEmployeeGroupId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionEmployeeLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionEmployeeLineId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionEmployeePositionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionEmployeePositionSideId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionTypeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PosNoId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PrefixId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Ability = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarRef = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + BirthDate = table.Column(type: "datetime(6)", nullable: false, comment: "วันเกิด"), + BloodGroupId = table.Column(type: "char(36)", nullable: true, comment: "Id กลุ่มเลือด", collation: "ascii_general_ci"), + CitizenId = table.Column(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน") + .Annotation("MySql:CharSet", "utf8mb4"), + Couple = table.Column(type: "tinyint(1)", nullable: true, comment: "คู่สมรส"), + CoupleCareer = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "อาชีพคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleCitizenId = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เลขที่บัตรประชาชนคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleFirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleLastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุลคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleLastNameOld = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุลคู่สมรส(เดิม)") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleLive = table.Column(type: "tinyint(1)", nullable: false, comment: "มีชีวิตคู่สมรส"), + CouplePrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้าคู่สมรส", collation: "ascii_general_ci"), + CreatedDate = table.Column(type: "datetime(6)", nullable: true), + CreatedUser = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CurrentAddress = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "ที่อยู่ปัจจุบัน") + .Annotation("MySql:CharSet", "utf8mb4"), + CurrentDistrictId = table.Column(type: "char(36)", nullable: true, comment: "Id เขตปัจจุบัน", collation: "ascii_general_ci"), + CurrentProvinceId = table.Column(type: "char(36)", nullable: true, comment: "Id จังหวัดปัจจุบัน", collation: "ascii_general_ci"), + CurrentSubDistrictId = table.Column(type: "char(36)", nullable: true, comment: "Id แขวงปัจจุบัน", collation: "ascii_general_ci"), + CurrentZipCode = table.Column(type: "varchar(5)", maxLength: 5, nullable: true, comment: "รหัสไปรษณีย์ปัจจุบัน") + .Annotation("MySql:CharSet", "utf8mb4"), + DateAppoint = table.Column(type: "datetime(6)", nullable: true), + DateRetire = table.Column(type: "datetime(6)", nullable: true), + DateStart = table.Column(type: "datetime(6)", nullable: true), + DutyTimeEffectiveDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่รอบการลงเวลามีผล"), + DutyTimeId = table.Column(type: "char(36)", nullable: true, comment: "รอบการลงเวลาเข้างาน", collation: "ascii_general_ci"), + EmployeeClass = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "ประเภทลูกจ้าง") + .Annotation("MySql:CharSet", "utf8mb4"), + EmployeeMoneyAllowance = table.Column(type: "double", nullable: true, comment: "เงินช่วยเหลือค่าครองชีพชั่วคราว"), + EmployeeMoneyEmployee = table.Column(type: "double", nullable: true, comment: "เงินสมทบประกันสังคม(ลูกจ้าง)"), + EmployeeMoneyEmployer = table.Column(type: "double", nullable: true, comment: "เงินสมทบประกันสังคม(นายจ้าง)"), + EmployeeMoneyIncrease = table.Column(type: "double", nullable: true, comment: "เงินเพิ่มการครองชีพชั่วคราว"), + EmployeeOc = table.Column(type: "longtext", nullable: true, comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + EmployeeType = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "ประเภทการจ้าง") + .Annotation("MySql:CharSet", "utf8mb4"), + EmployeeTypeIndividual = table.Column(type: "longtext", nullable: true, comment: "ประเภทบุคคล") + .Annotation("MySql:CharSet", "utf8mb4"), + EmployeeWage = table.Column(type: "double", nullable: true, comment: "ค่าจ้าง"), + EntryStatus = table.Column(type: "varchar(5)", maxLength: 5, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + FatherCareer = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "อาชีพบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherCitizenId = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เลขที่บัตรประชาชนบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherFirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherLastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุลบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherLive = table.Column(type: "tinyint(1)", nullable: false, comment: "มีชีวิตบิดา"), + FatherPrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้าบิดา", collation: "ascii_general_ci"), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + FirstNameOld = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ(เดิม)") + .Annotation("MySql:CharSet", "utf8mb4"), + GovAgeAbsent = table.Column(type: "int", nullable: false), + GovAgePlus = table.Column(type: "int", nullable: false), + GovernmentCode = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + IsLeave = table.Column(type: "tinyint(1)", nullable: false), + IsProbation = table.Column(type: "tinyint(1)", nullable: false), + IsTransfer = table.Column(type: "tinyint(1)", nullable: false), + IsVerified = table.Column(type: "tinyint(1)", nullable: false), + KeycloakId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastNameOld = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล(เดิม)") + .Annotation("MySql:CharSet", "utf8mb4"), + LeaveDate = table.Column(type: "datetime(6)", nullable: true), + LeaveDateOrder = table.Column(type: "datetime(6)", nullable: true), + LeaveDetail = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LeaveNumberOrder = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LeaveReason = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ModifiedDate = table.Column(type: "datetime(6)", nullable: true), + MotherCareer = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "อาชีพมารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherCitizenId = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เลขที่บัตรประชาชนมารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherFirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อมารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherLastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุลมารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherLive = table.Column(type: "tinyint(1)", nullable: false, comment: "มีชีวิตมารดา"), + MotherPrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้ามารดา", collation: "ascii_general_ci"), + Nationality = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติ") + .Annotation("MySql:CharSet", "utf8mb4"), + Oc = table.Column(type: "longtext", nullable: true, comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + OcId = table.Column(type: "char(36)", nullable: true, comment: "Id สังกัด", collation: "ascii_general_ci"), + OrganizationOrganization = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OrganizationOrganizationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + OrganizationShortName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OrganizationShortNameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Physical = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "สถานภาพทางกาย") + .Annotation("MySql:CharSet", "utf8mb4"), + PosNoEmployee = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่งลูกจ้าง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutive = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่งทางการบริหาร") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutiveId = table.Column(type: "char(36)", nullable: true, comment: "Id ตำแหน่งทางการบริหาร", collation: "ascii_general_ci"), + PositionExecutiveSide = table.Column(type: "longtext", nullable: true, comment: "ด้านทางการบริหาร") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutiveSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้านทางการบริหาร", collation: "ascii_general_ci"), + PositionLine = table.Column(type: "longtext", nullable: true, comment: "สายงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLineId = table.Column(type: "char(36)", nullable: true, comment: "Id สายงาน", collation: "ascii_general_ci"), + PositionPathSide = table.Column(type: "longtext", nullable: true, comment: "ด้าน/สาขา") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPathSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้าน/สาขา", collation: "ascii_general_ci"), + PrefixOldId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้า(เดิม)", collation: "ascii_general_ci"), + ProfileType = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Race = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ") + .Annotation("MySql:CharSet", "utf8mb4"), + ReasonSameDate = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RegistrationAddress = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "Id แขวงตามทะเบียนบ้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + RegistrationDistrictId = table.Column(type: "char(36)", nullable: true, comment: "Id เขตตามทะเบียนบ้าน", collation: "ascii_general_ci"), + RegistrationProvinceId = table.Column(type: "char(36)", nullable: true, comment: "Id จังหวัดตามทะเบียนบ้าน", collation: "ascii_general_ci"), + RegistrationSame = table.Column(type: "tinyint(1)", nullable: true, comment: "ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"), + RegistrationSubDistrictId = table.Column(type: "char(36)", nullable: true, comment: "แขวงตามทะเบียนบ้าน", collation: "ascii_general_ci"), + RegistrationZipCode = table.Column(type: "varchar(5)", maxLength: 5, nullable: true, comment: "รหัสไปรษณีย์ตามทะเบียนบ้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + RelationshipId = table.Column(type: "char(36)", nullable: true, comment: "Id สถานะภาพ", collation: "ascii_general_ci"), + ReligionId = table.Column(type: "char(36)", nullable: true, comment: "Id ศาสนา", collation: "ascii_general_ci"), + TelephoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "เบอร์โทร") + .Annotation("MySql:CharSet", "utf8mb4"), + TransferDate = table.Column(type: "datetime(6)", nullable: true), + VerifiedDate = table.Column(type: "datetime(6)", nullable: true), + VerifiedUser = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Profile", x => x.Id); + table.ForeignKey( + name: "FK_Profile_Document_AvatarId", + column: x => x.AvatarId, + principalTable: "Document", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_Genders_GenderId", + column: x => x.GenderId, + principalTable: "Genders", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_LimitLeave_LimitLeaveId", + column: x => x.LimitLeaveId, + principalTable: "LimitLeave", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionEmployeeGroups_PositionEmployeeGroupId", + column: x => x.PositionEmployeeGroupId, + principalTable: "PositionEmployeeGroups", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionEmployeeLevels_PositionEmployeeLevelId", + column: x => x.PositionEmployeeLevelId, + principalTable: "PositionEmployeeLevels", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionEmployeeLines_PositionEmployeeLineId", + column: x => x.PositionEmployeeLineId, + principalTable: "PositionEmployeeLines", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionEmployeePositionSides_PositionEmployeePositi~", + column: x => x.PositionEmployeePositionSideId, + principalTable: "PositionEmployeePositionSides", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionEmployeePositions_PositionEmployeePositionId", + column: x => x.PositionEmployeePositionId, + principalTable: "PositionEmployeePositions", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionLevels_PositionLevelId", + column: x => x.PositionLevelId, + principalTable: "PositionLevels", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionNumbers_PosNoId", + column: x => x.PosNoId, + principalTable: "PositionNumbers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionPaths_PositionId", + column: x => x.PositionId, + principalTable: "PositionPaths", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_PositionTypes_PositionTypeId", + column: x => x.PositionTypeId, + principalTable: "PositionTypes", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Profile_Prefixes_PrefixId", + column: x => x.PrefixId, + principalTable: "Prefixes", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AvailablePositionLevels", + 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"), + PositionLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionMasterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_AvailablePositionLevels", x => x.Id); + table.ForeignKey( + name: "FK_AvailablePositionLevels_PositionLevels_PositionLevelId", + column: x => x.PositionLevelId, + principalTable: "PositionLevels", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_AvailablePositionLevels_PositionMasters_PositionMasterId", + column: x => x.PositionMasterId, + principalTable: "PositionMasters", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "OrganizationPositions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + IsDirector = table.Column(type: "tinyint(1)", nullable: true, comment: "Is Director"), + PositionUserNote = table.Column(type: "longtext", nullable: true, comment: "positionUserNote") + .Annotation("MySql:CharSet", "utf8mb4"), + 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"), + OrganizationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionMasterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionNumberId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_OrganizationPositions", x => x.Id); + table.ForeignKey( + name: "FK_OrganizationPositions_Organizations_OrganizationId", + column: x => x.OrganizationId, + principalTable: "Organizations", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_OrganizationPositions_PositionMasters_PositionMasterId", + column: x => x.PositionMasterId, + principalTable: "PositionMasters", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_OrganizationPositions_PositionNumbers_PositionNumberId", + column: x => x.PositionNumberId, + principalTable: "PositionNumbers", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PositionMasterHistoryEntity", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Position = table.Column(type: "longtext", nullable: true, comment: "Position") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPath = table.Column(type: "longtext", nullable: true, comment: "PositionPath") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionType = table.Column(type: "longtext", nullable: true, comment: "PositionType") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutive = table.Column(type: "longtext", nullable: true, comment: "PositionExecutive") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutiveSide = table.Column(type: "longtext", nullable: true, comment: "PositionExecutiveSide") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPathSide = table.Column(type: "longtext", nullable: true, comment: "PositionPathSide") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLine = table.Column(type: "longtext", nullable: true, comment: "PositionLine") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionStatus = table.Column(type: "longtext", nullable: true, comment: "PositionStatus") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionCondition = table.Column(type: "longtext", nullable: true, comment: "PositionCondition") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLevel = table.Column(type: "longtext", nullable: true, comment: "PositionLevel") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionMasterUserNote = table.Column(type: "longtext", nullable: true, comment: "PositionMasterUserNote") + .Annotation("MySql:CharSet", "utf8mb4"), + IsDirector = table.Column(type: "tinyint(1)", nullable: true, comment: "IsDirector"), + Qualification = table.Column(type: "longtext", nullable: true, comment: "คุณวุฒิ") + .Annotation("MySql:CharSet", "utf8mb4"), + 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"), + PositionMasterEntityId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PositionExecutiveSideObject = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPathSideObject = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_PositionMasterHistoryEntity", x => x.Id); + table.ForeignKey( + name: "FK_PositionMasterHistoryEntity_PositionMasters_PositionMasterEn~", + column: x => x.PositionMasterEntityId, + principalTable: "PositionMasters", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "SubDistricts", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(150)", maxLength: 150, nullable: false, comment: "เขต/อำเภอ") + .Annotation("MySql:CharSet", "utf8mb4"), + ZipCode = table.Column(type: "varchar(10)", maxLength: 10, nullable: false, comment: "รหัสไปรษณีย์") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"), + 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"), + DistrictId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_SubDistricts", x => x.Id); + table.ForeignKey( + name: "FK_SubDistricts_Districts_DistrictId", + column: x => x.DistrictId, + principalTable: "Districts", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileAbility", + 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: true, collation: "ascii_general_ci"), + DateEnd = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่สิ้นสุด"), + DateStart = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่เริ่มต้น"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Field = table.Column(type: "longtext", nullable: true, comment: "ด้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + Reference = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4"), + Remark = table.Column(type: "longtext", nullable: true, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileAbility", x => x.Id); + table.ForeignKey( + name: "FK_ProfileAbility_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileAddressHistory", + 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: true, collation: "ascii_general_ci"), + CurrentAddress = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "ที่อยู่ปัจจุบัน") + .Annotation("MySql:CharSet", "utf8mb4"), + CurrentDistrict = table.Column(type: "longtext", nullable: true, comment: "เขตปัจจุบัน") + .Annotation("MySql:CharSet", "utf8mb4"), + CurrentDistrictId = table.Column(type: "char(36)", nullable: true, comment: "Id เขตปัจจุบัน", collation: "ascii_general_ci"), + CurrentProvince = table.Column(type: "longtext", nullable: true, comment: "จังหวัดปัจจุบัน") + .Annotation("MySql:CharSet", "utf8mb4"), + CurrentProvinceId = table.Column(type: "char(36)", nullable: true, comment: "Id จังหวัดปัจจุบัน", collation: "ascii_general_ci"), + CurrentSubDistrict = table.Column(type: "longtext", nullable: true, comment: "แขวงปัจจุบัน") + .Annotation("MySql:CharSet", "utf8mb4"), + CurrentSubDistrictId = table.Column(type: "char(36)", nullable: true, comment: "Id แขวงปัจจุบัน", collation: "ascii_general_ci"), + CurrentZipCode = table.Column(type: "varchar(5)", maxLength: 5, nullable: true, comment: "รหัสไปรษณีย์ปัจจุบัน") + .Annotation("MySql:CharSet", "utf8mb4"), + RegistrationAddress = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "ที่อยู่ตามทะเบียนบ้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + RegistrationDistrict = table.Column(type: "longtext", nullable: true, comment: "เขตตามทะเบียนบ้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + RegistrationDistrictId = table.Column(type: "char(36)", nullable: true, comment: "Id เขตตามทะเบียนบ้าน", collation: "ascii_general_ci"), + RegistrationProvince = table.Column(type: "longtext", nullable: true, comment: "จังหวัดตามทะเบียนบ้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + RegistrationProvinceId = table.Column(type: "char(36)", nullable: true, comment: "Id จังหวัดตามทะเบียนบ้าน", collation: "ascii_general_ci"), + RegistrationSame = table.Column(type: "tinyint(1)", nullable: true, comment: "ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"), + RegistrationSubDistrict = table.Column(type: "longtext", nullable: true, comment: "แขวงตามทะเบียนบ้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + RegistrationSubDistrictId = table.Column(type: "char(36)", nullable: true, comment: "Id แขวงตามทะเบียนบ้าน", collation: "ascii_general_ci"), + RegistrationZipCode = table.Column(type: "varchar(5)", maxLength: 5, nullable: true, comment: "รหัสไปรษณีย์ตามทะเบียนบ้าน") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileAddressHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileAddressHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileAssessment", + 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: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ได้รับ"), + Name = table.Column(type: "longtext", nullable: true, comment: "ชื่อแบบประเมิน") + .Annotation("MySql:CharSet", "utf8mb4"), + Point1 = table.Column(type: "double", nullable: true, comment: "ผลประเมินส่วนที่1 (คะแนน)"), + Point1Total = table.Column(type: "double", nullable: true, comment: "ส่วนที่1 (คะแนน)"), + Point2 = table.Column(type: "double", nullable: true, comment: "ผลประเมินส่วนที่2 (คะแนน)"), + Point2Total = table.Column(type: "double", nullable: true, comment: "ส่วนที่2 (คะแนน)"), + PointSum = table.Column(type: "double", nullable: true, comment: "ผลประเมินรวม (คะแนน)"), + PointSumTotal = table.Column(type: "double", nullable: true, comment: "ผลรวม (คะแนน)") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileAssessment", x => x.Id); + table.ForeignKey( + name: "FK_ProfileAssessment_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileAvatarHistory", + 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"), + AvatarFileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileAvatarHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileAvatarHistory_Document_AvatarFileId", + column: x => x.AvatarFileId, + principalTable: "Document", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_ProfileAvatarHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileCertificate", + 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: true, collation: "ascii_general_ci"), + CertificateNo = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เลขที่ใบอนุญาต") + .Annotation("MySql:CharSet", "utf8mb4"), + CertificateType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อใบอนุญาต") + .Annotation("MySql:CharSet", "utf8mb4"), + ExpireDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่หมดอายุ"), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + IssueDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ออกใบอนุญาต"), + Issuer = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หน่วยงานผู้ออกใบอนุญาต") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileCertificate", x => x.Id); + table.ForeignKey( + name: "FK_ProfileCertificate_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileChangeName", + 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: true, collation: "ascii_general_ci"), + ProfileId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุล") + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + PrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้า", collation: "ascii_general_ci"), + Status = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สถานะ") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileChangeName", x => x.Id); + table.ForeignKey( + name: "FK_ProfileChangeName_Document_DocumentId", + column: x => x.DocumentId, + principalTable: "Document", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfileChangeName_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileChildren", + 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: true, collation: "ascii_general_ci"), + ChildrenCareer = table.Column(type: "longtext", nullable: true, comment: "อาชีพบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenFirstName = table.Column(type: "longtext", nullable: true, comment: "ชื่อบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenLastName = table.Column(type: "longtext", nullable: true, comment: "นามสกุลบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenPrefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้าบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenPrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้าบุตร", collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileChildren", x => x.Id); + table.ForeignKey( + name: "FK_ProfileChildren_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileCoupleHistory", + columns: table => new + { + Id = table.Column(type: "int", nullable: false, comment: "ไม่ใช้") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Career = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedDate = table.Column(type: "datetime(6)", nullable: false), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileCoupleHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileCoupleHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileCurrentAddressHistory", + columns: table => new + { + Id = table.Column(type: "int", nullable: false, comment: "ไม่ใช้") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Address = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedDate = table.Column(type: "datetime(6)", nullable: false), + DistrictId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ProvinceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SubDistrictId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ZipCode = table.Column(type: "varchar(5)", maxLength: 5, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileCurrentAddressHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileCurrentAddressHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileDiscipline", + 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: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี"), + Detail = table.Column(type: "text", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Level = table.Column(type: "longtext", nullable: true, comment: "ระดับความผิด") + .Annotation("MySql:CharSet", "utf8mb4"), + RefCommandDate = table.Column(type: "datetime(6)", nullable: true, comment: "เอกสารอ้างอิง (ลงวันที่)"), + RefCommandNo = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileDiscipline", x => x.Id); + table.ForeignKey( + name: "FK_ProfileDiscipline_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileDuty", + 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: true, collation: "ascii_general_ci"), + DateEnd = table.Column(type: "datetime(6)", nullable: true, comment: "สิ้นสุด"), + DateStart = table.Column(type: "datetime(6)", nullable: true, comment: "เริ่มต้น"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Reference = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileDuty", x => x.Id); + table.ForeignKey( + name: "FK_ProfileDuty_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileEducation", + 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: true, collation: "ascii_general_ci"), + Country = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ประเทศ") + .Annotation("MySql:CharSet", "utf8mb4"), + Degree = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "วุฒิการศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"), + Duration = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ระยะเวลา") + .Annotation("MySql:CharSet", "utf8mb4"), + DurationYear = table.Column(type: "int", nullable: false, comment: "ระยะเวลาหลักสูตร"), + EducationLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"), + EducationLevelId = table.Column(type: "char(36)", nullable: true, comment: "Id ระดับศึกษา", collation: "ascii_general_ci"), + EndDate = table.Column(type: "datetime(6)", nullable: true, comment: "ถึง"), + Field = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "สาขาวิชา/ทาง") + .Annotation("MySql:CharSet", "utf8mb4"), + FinishDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่สำเร็จการศึกษา"), + FundName = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ทุน") + .Annotation("MySql:CharSet", "utf8mb4"), + Gpa = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เกรดเฉลี่ย") + .Annotation("MySql:CharSet", "utf8mb4"), + Institute = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "สถานศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + Other = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ข้อมูลการติดต่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPath = table.Column(type: "longtext", nullable: true, comment: "เป็นวุฒิการศึกษาในตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPathId = table.Column(type: "char(36)", nullable: true, comment: "Id เป็นวุฒิการศึกษาในตำแหน่ง", collation: "ascii_general_ci"), + StartDate = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileEducation", x => x.Id); + table.ForeignKey( + name: "FK_ProfileEducation_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileEmployment", + 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: true, collation: "ascii_general_ci"), + Command = table.Column(type: "longtext", nullable: true, comment: "คำสั่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่จ้าง") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileEmployment", x => x.Id); + table.ForeignKey( + name: "FK_ProfileEmployment_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileFamilyHistory", + 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: true, collation: "ascii_general_ci"), + Couple = table.Column(type: "tinyint(1)", nullable: true, comment: "คู่สมรส"), + CoupleCareer = table.Column(type: "longtext", nullable: true, comment: "อาชีพคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleFirstName = table.Column(type: "longtext", nullable: true, comment: "ชื่อคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleLastName = table.Column(type: "longtext", nullable: true, comment: "นามสกุลคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CoupleLastNameOld = table.Column(type: "longtext", nullable: true, comment: "นามสกุลคู่สมรส(เดิม)") + .Annotation("MySql:CharSet", "utf8mb4"), + CouplePrefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้าคู่สมรส") + .Annotation("MySql:CharSet", "utf8mb4"), + CouplePrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้าคู่สมรส", collation: "ascii_general_ci"), + FatherCareer = table.Column(type: "longtext", nullable: true, comment: "อาชีพบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherFirstName = table.Column(type: "longtext", nullable: true, comment: "ชื่อบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherLastName = table.Column(type: "longtext", nullable: true, comment: "นามสกุลบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherPrefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้าบิดา") + .Annotation("MySql:CharSet", "utf8mb4"), + FatherPrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้าบิดา", collation: "ascii_general_ci"), + MotherCareer = table.Column(type: "longtext", nullable: true, comment: "อาชีพมารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherFirstName = table.Column(type: "longtext", nullable: true, comment: "ชื่อมารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherLastName = table.Column(type: "longtext", nullable: true, comment: "นามสกุลมารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherPrefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้ามารดา") + .Annotation("MySql:CharSet", "utf8mb4"), + MotherPrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้ามารดา", collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileFamilyHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileFamilyHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileFatherHistory", + columns: table => new + { + Id = table.Column(type: "int", nullable: false, comment: "ไม่ใช้") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Career = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedDate = table.Column(type: "datetime(6)", nullable: false), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileFatherHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileFatherHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileGovernmentHistory", + 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: true, collation: "ascii_general_ci"), + DateAppoint = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่สั่งบรรจุ"), + DateStart = table.Column(type: "datetime(6)", nullable: true, comment: "เริ่มปฎิบัติราชการ"), + GovAge = table.Column(type: "longtext", nullable: true, comment: "อายุราชการ") + .Annotation("MySql:CharSet", "utf8mb4"), + GovAgeAbsent = table.Column(type: "int", nullable: true, comment: "ขาดราชการ"), + GovAgePlus = table.Column(type: "int", nullable: true, comment: "อายุราชการเกื้อกูล"), + Oc = table.Column(type: "longtext", nullable: true, comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + OcId = table.Column(type: "char(36)", nullable: true, comment: "Id สังกัด", collation: "ascii_general_ci"), + PosNo = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PosNoId = table.Column(type: "char(36)", nullable: true, comment: "Id เลขที่ตำแหน่ง", collation: "ascii_general_ci"), + Position = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeeGroup = table.Column(type: "longtext", nullable: true, comment: "กลุ่มงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeeLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับชั้นงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeePosition = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeePositionSide = table.Column(type: "longtext", nullable: true, comment: "ด้านของตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutive = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่งทางการบริหาร") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionId = table.Column(type: "char(36)", nullable: true, comment: "Id ตำแหน่ง", collation: "ascii_general_ci"), + PositionLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLine = table.Column(type: "longtext", nullable: true, comment: "สายงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionType = table.Column(type: "longtext", nullable: true, comment: "ประเภทตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + ReasonSameDate = table.Column(type: "longtext", nullable: true, comment: "เหตุผลกรณีไม่ตรงวัน") + .Annotation("MySql:CharSet", "utf8mb4"), + RetireDate = table.Column(type: "longtext", nullable: true, comment: "วันเกษียณอายุ") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileGovernmentHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileGovernmentHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileHistory", + 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: true, collation: "ascii_general_ci"), + BirthDate = table.Column(type: "datetime(6)", nullable: false, comment: "วันเกิด"), + BloodGroup = table.Column(type: "longtext", nullable: true, comment: "กลุ่มเลือด") + .Annotation("MySql:CharSet", "utf8mb4"), + BloodGroupId = table.Column(type: "char(36)", nullable: true, comment: "Id กลุ่มเลือด", collation: "ascii_general_ci"), + CitizenId = table.Column(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน") + .Annotation("MySql:CharSet", "utf8mb4"), + EmployeeClass = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "ประเภทลูกจ้าง") + .Annotation("MySql:CharSet", "utf8mb4"), + EmployeeType = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "ประเภทการจ้าง") + .Annotation("MySql:CharSet", "utf8mb4"), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + Gender = table.Column(type: "longtext", nullable: true, comment: "เพศ") + .Annotation("MySql:CharSet", "utf8mb4"), + GenderId = table.Column(type: "char(36)", nullable: true, comment: "Id เพศ", collation: "ascii_general_ci"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล") + .Annotation("MySql:CharSet", "utf8mb4"), + Nationality = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติ") + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + PrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้า", collation: "ascii_general_ci"), + Race = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ") + .Annotation("MySql:CharSet", "utf8mb4"), + Relationship = table.Column(type: "longtext", nullable: true, comment: "สถานะภาพ") + .Annotation("MySql:CharSet", "utf8mb4"), + RelationshipId = table.Column(type: "char(36)", nullable: true, comment: "Id สถานะภาพ", collation: "ascii_general_ci"), + Religion = table.Column(type: "longtext", nullable: true, comment: "ศาสนา") + .Annotation("MySql:CharSet", "utf8mb4"), + ReligionId = table.Column(type: "char(36)", nullable: true, comment: "Id ศาสนา", collation: "ascii_general_ci"), + TelephoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "เบอร์โทร") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileHonor", + 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: true, collation: "ascii_general_ci"), + Detail = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + IssueDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ได้รับ"), + Issuer = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หน่วยงานที่ออก") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileHonor", x => x.Id); + table.ForeignKey( + name: "FK_ProfileHonor_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileInsignia", + 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"), + InsigniaId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ProfileId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DateAnnounce = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ประกาศในราชกิจจาฯ"), + InsigniaType = table.Column(type: "longtext", nullable: true, comment: "ประเภท") + .Annotation("MySql:CharSet", "utf8mb4"), + Issue = table.Column(type: "varchar(300)", maxLength: 300, nullable: true, comment: "ราชกิจจาฯ ฉบับที่") + .Annotation("MySql:CharSet", "utf8mb4"), + No = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "ลำดับที่") + .Annotation("MySql:CharSet", "utf8mb4"), + Page = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "หน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiveDate = table.Column(type: "datetime(6)", nullable: true, comment: "ลงวันที่"), + RefCommandDate = table.Column(type: "datetime(6)", nullable: true, comment: "เอกสารอ้างอิง (ลงวันที่)"), + RefCommandNo = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)") + .Annotation("MySql:CharSet", "utf8mb4"), + Section = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "ตอน") + .Annotation("MySql:CharSet", "utf8mb4"), + Volume = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "เล่ม") + .Annotation("MySql:CharSet", "utf8mb4"), + VolumeNo = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "เล่มที่") + .Annotation("MySql:CharSet", "utf8mb4"), + Year = table.Column(type: "int", nullable: false, comment: "ปีที่ยื่นขอ") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileInsignia", x => x.Id); + table.ForeignKey( + name: "FK_ProfileInsignia_Insignias_InsigniaId", + column: x => x.InsigniaId, + principalTable: "Insignias", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfileInsignia_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileLeave", + 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: true, collation: "ascii_general_ci"), + TypeLeaveId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DateEndLeave = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี ที่สิ้นสุดลา"), + DateStartLeave = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี ที่เริ่มลา"), + NumLeave = table.Column(type: "double", nullable: true, comment: "ลาครั้งที่"), + Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "longtext", nullable: true, comment: "สถานะ") + .Annotation("MySql:CharSet", "utf8mb4"), + SumLeave = table.Column(type: "double", nullable: true, comment: "ลามาแล้ว"), + TotalLeave = table.Column(type: "double", nullable: true, comment: "รวมเป็น") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileLeave", x => x.Id); + table.ForeignKey( + name: "FK_ProfileLeave_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfileLeave_TypeLeave_TypeLeaveId", + column: x => x.TypeLeaveId, + principalTable: "TypeLeave", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileMotherHistory", + columns: table => new + { + Id = table.Column(type: "int", nullable: false, comment: "ไม่ใช้") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Career = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedDate = table.Column(type: "datetime(6)", nullable: false), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileMotherHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileMotherHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileNopaid", + 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: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Reference = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileNopaid", x => x.Id); + table.ForeignKey( + name: "FK_ProfileNopaid_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileOther", + 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: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileOther", x => x.Id); + table.ForeignKey( + name: "FK_ProfileOther_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfilePaper", + 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"), + ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CategoryName = table.Column(type: "varchar(255)", maxLength: 255, nullable: false, comment: "ประเภทไฟล์-ไม่ใช้") + .Annotation("MySql:CharSet", "utf8mb4"), + Detail = table.Column(type: "varchar(255)", maxLength: 255, nullable: false, comment: "ชื่อไฟล์") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfilePaper", x => x.Id); + table.ForeignKey( + name: "FK_ProfilePaper_Document_DocumentId", + column: x => x.DocumentId, + principalTable: "Document", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_ProfilePaper_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileRegistrationAddressHistory", + columns: table => new + { + Id = table.Column(type: "int", nullable: false, comment: "ไม่ใช้") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Address = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedDate = table.Column(type: "datetime(6)", nullable: false), + DistrictId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ProvinceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SubDistrictId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ZipCode = table.Column(type: "varchar(5)", maxLength: 5, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileRegistrationAddressHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileRegistrationAddressHistory_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileSalary", + 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"), + PositionLevelId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ProfileId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Amount = table.Column(type: "double", nullable: true, comment: "เงินเดือน"), + CommandNo = table.Column(type: "longtext", nullable: false, comment: "เลขที่คำสั่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + CommandTypeName = table.Column(type: "longtext", nullable: false, comment: "ประเภทคำสั่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี รับตำแหน่ง"), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + MouthSalaryAmount = table.Column(type: "double", nullable: true, comment: "เงินค่าตอบแทนรายเดือน"), + OcId = table.Column(type: "char(36)", nullable: true, comment: "Id สังกัด", collation: "ascii_general_ci"), + Order = table.Column(type: "int", nullable: true, comment: "ลำดับ"), + OrganizationShortNameId = table.Column(type: "char(36)", nullable: true, comment: "Id ชื่อย่อหน่วยงาน", collation: "ascii_general_ci"), + PosNoEmployee = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่งลูกจ้าง") + .Annotation("MySql:CharSet", "utf8mb4"), + PosNoId = table.Column(type: "char(36)", nullable: true, comment: "Id เลขที่ตำแหน่ง", collation: "ascii_general_ci"), + PositionEmployeeGroupId = table.Column(type: "char(36)", nullable: true, comment: "Id กลุ่มงาน", collation: "ascii_general_ci"), + PositionEmployeeLevelId = table.Column(type: "char(36)", nullable: true, comment: " Id ระดับชั้นงาน", collation: "ascii_general_ci"), + PositionEmployeePositionId = table.Column(type: "char(36)", nullable: true, comment: "Id ตำแหน่ง", collation: "ascii_general_ci"), + PositionEmployeePositionSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้านของตำแหน่ง", collation: "ascii_general_ci"), + PositionExecutiveId = table.Column(type: "char(36)", nullable: true, comment: "Id ตำแหน่งทางการบริหาร", collation: "ascii_general_ci"), + PositionExecutiveSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้านทางการบริหาร", collation: "ascii_general_ci"), + PositionId = table.Column(type: "char(36)", nullable: true, comment: "Id ตำแหน่ง", collation: "ascii_general_ci"), + PositionLineId = table.Column(type: "char(36)", nullable: true, comment: "Id สายงาน", collation: "ascii_general_ci"), + PositionPathSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้าน/สาขา", collation: "ascii_general_ci"), + PositionSalaryAmount = table.Column(type: "double", nullable: true, comment: "เงินประจำตำแหน่ง"), + PositionTypeId = table.Column(type: "char(36)", nullable: true, comment: "Id ประเภทตำแหน่ง", collation: "ascii_general_ci"), + RefCommandNo = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)") + .Annotation("MySql:CharSet", "utf8mb4"), + SalaryClass = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง (รายละเอียด)") + .Annotation("MySql:CharSet", "utf8mb4"), + SalaryRef = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4"), + SalaryStatus = table.Column(type: "longtext", nullable: true, comment: "ประเภทตำแหน่งกรณีพิเศษ") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileSalary", x => x.Id); + table.ForeignKey( + name: "FK_ProfileSalary_PositionLevels_PositionLevelId", + column: x => x.PositionLevelId, + principalTable: "PositionLevels", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfileSalary_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileTraining", + 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: true, collation: "ascii_general_ci"), + DateOrder = table.Column(type: "datetime(6)", nullable: true, comment: "คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"), + Department = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + Duration = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "รวมระยะเวลาในการฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + EndDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันสิ้นสุดการฝึกอบรม/ดูงาน"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "ชื่อโครงการ/หลักสูตรการฝึกอบรม") + .Annotation("MySql:CharSet", "utf8mb4"), + NumberOrder = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ") + .Annotation("MySql:CharSet", "utf8mb4"), + Place = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "สถานที่ฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + StartDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันเริ่มต้นการฝึกอบรม/ดูงาน"), + Topic = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หัวข้อการฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + Yearly = table.Column(type: "int", maxLength: 200, nullable: true, comment: "ปีที่อบรม (พ.ศ.)") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileTraining", x => x.Id); + table.ForeignKey( + name: "FK_ProfileTraining_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfilePositions", + 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"), + OrganizationPositionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ProfileId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + IsPublished = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ProfilePositions", x => x.Id); + table.ForeignKey( + name: "FK_ProfilePositions_OrganizationPositions_OrganizationPositionId", + column: x => x.OrganizationPositionId, + principalTable: "OrganizationPositions", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfilePositions_Profile_ProfileId", + column: x => x.ProfileId, + principalTable: "Profile", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileAbilityHistory", + 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"), + ProfileAbilityId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DateEnd = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่สิ้นสุด"), + DateStart = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่เริ่มต้น"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Field = table.Column(type: "longtext", nullable: true, comment: "ด้าน") + .Annotation("MySql:CharSet", "utf8mb4"), + Reference = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4"), + Remark = table.Column(type: "longtext", nullable: true, comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileAbilityHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileAbilityHistory_ProfileAbility_ProfileAbilityId", + column: x => x.ProfileAbilityId, + principalTable: "ProfileAbility", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileAssessmentHistory", + 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"), + ProfileAssessmentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ได้รับ"), + Name = table.Column(type: "longtext", nullable: true, comment: "ชื่อแบบประเมิน") + .Annotation("MySql:CharSet", "utf8mb4"), + Point1 = table.Column(type: "double", nullable: true, comment: "ผลประเมินส่วนที่1 (คะแนน)"), + Point1Total = table.Column(type: "double", nullable: true, comment: "ส่วนที่1 (คะแนน)"), + Point2 = table.Column(type: "double", nullable: true, comment: "ผลประเมินส่วนที่2 (คะแนน)"), + Point2Total = table.Column(type: "double", nullable: true, comment: "ส่วนที่2 (คะแนน)"), + PointSum = table.Column(type: "double", nullable: true, comment: "ผลประเมินรวม (คะแนน)"), + PointSumTotal = table.Column(type: "double", nullable: true, comment: "ผลรวม (คะแนน)") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileAssessmentHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileAssessmentHistory_ProfileAssessment_ProfileAssessment~", + column: x => x.ProfileAssessmentId, + principalTable: "ProfileAssessment", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileCertificateHistory", + 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"), + ProfileCertificateId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + CertificateNo = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เลขที่ใบอนุญาต") + .Annotation("MySql:CharSet", "utf8mb4"), + CertificateType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อใบอนุญาต") + .Annotation("MySql:CharSet", "utf8mb4"), + ExpireDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่หมดอายุ"), + IssueDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ออกใบอนุญาต"), + Issuer = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หน่วยงานผู้ออกใบอนุญาต") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileCertificateHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileCertificateHistory_ProfileCertificate_ProfileCertific~", + column: x => x.ProfileCertificateId, + principalTable: "ProfileCertificate", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileChangeNameHistory", + 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: true, collation: "ascii_general_ci"), + ProfileChangeNameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุล") + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + PrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้า", collation: "ascii_general_ci"), + Status = table.Column(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สถานะ") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileChangeNameHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileChangeNameHistory_Document_DocumentId", + column: x => x.DocumentId, + principalTable: "Document", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfileChangeNameHistory_ProfileChangeName_ProfileChangeName~", + column: x => x.ProfileChangeNameId, + principalTable: "ProfileChangeName", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileDisciplineHistory", + 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"), + ProfileDisciplineId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี"), + Detail = table.Column(type: "text", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Level = table.Column(type: "longtext", nullable: true, comment: "ระดับความผิด") + .Annotation("MySql:CharSet", "utf8mb4"), + RefCommandDate = table.Column(type: "datetime(6)", nullable: true, comment: "เอกสารอ้างอิง (ลงวันที่)"), + RefCommandNo = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileDisciplineHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileDisciplineHistory_ProfileDiscipline_ProfileDiscipline~", + column: x => x.ProfileDisciplineId, + principalTable: "ProfileDiscipline", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileDutyHistory", + 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"), + ProfileDutyId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DateEnd = table.Column(type: "datetime(6)", nullable: true, comment: "สิ้นสุด"), + DateStart = table.Column(type: "datetime(6)", nullable: true, comment: "เริ่มต้น"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Reference = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileDutyHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileDutyHistory_ProfileDuty_ProfileDutyId", + column: x => x.ProfileDutyId, + principalTable: "ProfileDuty", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileEducationHistory", + 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"), + ProfileEducationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Country = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ประเทศ") + .Annotation("MySql:CharSet", "utf8mb4"), + Degree = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "วุฒิการศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"), + Duration = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ระยะเวลา") + .Annotation("MySql:CharSet", "utf8mb4"), + DurationYear = table.Column(type: "int", nullable: false, comment: "ระยะเวลาหลักสูตร"), + EducationLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"), + EducationLevelId = table.Column(type: "char(36)", nullable: true, comment: "Id ระดับศึกษา", collation: "ascii_general_ci"), + EndDate = table.Column(type: "datetime(6)", nullable: true, comment: "ถึง"), + Field = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "สาขาวิชา/ทาง") + .Annotation("MySql:CharSet", "utf8mb4"), + FinishDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่สำเร็จการศึกษา"), + FundName = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ทุน") + .Annotation("MySql:CharSet", "utf8mb4"), + Gpa = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เกรดเฉลี่ย") + .Annotation("MySql:CharSet", "utf8mb4"), + Institute = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "สถานศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"), + Other = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ข้อมูลการติดต่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPath = table.Column(type: "longtext", nullable: true, comment: "เป็นวุฒิการศึกษาในตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPathId = table.Column(type: "char(36)", nullable: true, comment: "Id เป็นวุฒิการศึกษาในตำแหน่ง", collation: "ascii_general_ci"), + StartDate = table.Column(type: "datetime(6)", nullable: true, comment: "ตั้งแต่") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileEducationHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileEducationHistory_ProfileEducation_ProfileEducationId", + column: x => x.ProfileEducationId, + principalTable: "ProfileEducation", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileChildrenHistory", + 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"), + ChildrenCareer = table.Column(type: "longtext", nullable: true, comment: "อาชีพบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenFirstName = table.Column(type: "longtext", nullable: true, comment: "ชื่อบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenLastName = table.Column(type: "longtext", nullable: true, comment: "นามสกุลบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenPrefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้าบุตร") + .Annotation("MySql:CharSet", "utf8mb4"), + ChildrenPrefixId = table.Column(type: "char(36)", nullable: true, comment: "Id คำนำหน้าบุตร", collation: "ascii_general_ci"), + ProfileChildrenId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ProfileFamilyHistoryId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileChildrenHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileChildrenHistory_ProfileChildren_ProfileChildrenId", + column: x => x.ProfileChildrenId, + principalTable: "ProfileChildren", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfileChildrenHistory_ProfileFamilyHistory_ProfileFamilyHis~", + column: x => x.ProfileFamilyHistoryId, + principalTable: "ProfileFamilyHistory", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileHonorHistory", + 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"), + ProfileHonorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Detail = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + IssueDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ได้รับ"), + Issuer = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หน่วยงานที่ออก") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileHonorHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileHonorHistory_ProfileHonor_ProfileHonorId", + column: x => x.ProfileHonorId, + principalTable: "ProfileHonor", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileInsigniaHistory", + 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"), + ProfileInsigniaId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DateAnnounce = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่ประกาศในราชกิจจาฯ"), + Insignia = table.Column(type: "longtext", nullable: true, comment: "ชื่อเครื่องราชฯ") + .Annotation("MySql:CharSet", "utf8mb4"), + InsigniaId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + InsigniaType = table.Column(type: "longtext", nullable: true, comment: "ประเภท") + .Annotation("MySql:CharSet", "utf8mb4"), + Issue = table.Column(type: "varchar(300)", maxLength: 300, nullable: true, comment: "ราชกิจจาฯ ฉบับที่") + .Annotation("MySql:CharSet", "utf8mb4"), + No = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "ลำดับที่") + .Annotation("MySql:CharSet", "utf8mb4"), + Page = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "หน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiveDate = table.Column(type: "datetime(6)", nullable: true, comment: "ลงวันที่"), + Section = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "ตอน") + .Annotation("MySql:CharSet", "utf8mb4"), + Volume = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "เล่ม") + .Annotation("MySql:CharSet", "utf8mb4"), + VolumeNo = table.Column(type: "varchar(30)", maxLength: 30, nullable: true, comment: "เล่มที่") + .Annotation("MySql:CharSet", "utf8mb4"), + Year = table.Column(type: "int", nullable: false, comment: "ปีที่ยื่นขอ") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileInsigniaHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileInsigniaHistory_ProfileInsignia_ProfileInsigniaId", + column: x => x.ProfileInsigniaId, + principalTable: "ProfileInsignia", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileLeaveHistory", + 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"), + ProfileLeaveId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TypeLeaveId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DateEndLeave = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี ที่สิ้นสุดลา"), + DateStartLeave = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี ที่เริ่มลา"), + NumLeave = table.Column(type: "double", nullable: true, comment: "ลาครั้งที่"), + Reason = table.Column(type: "longtext", nullable: true, comment: "เหตุผล") + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "longtext", nullable: true, comment: "สถานะ") + .Annotation("MySql:CharSet", "utf8mb4"), + SumLeave = table.Column(type: "double", nullable: true, comment: "ลามาแล้ว"), + TotalLeave = table.Column(type: "double", nullable: true, comment: "รวมเป็น") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileLeaveHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileLeaveHistory_ProfileLeave_ProfileLeaveId", + column: x => x.ProfileLeaveId, + principalTable: "ProfileLeave", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ProfileLeaveHistory_TypeLeave_TypeLeaveId", + column: x => x.TypeLeaveId, + principalTable: "TypeLeave", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileNopaidHistory", + 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"), + ProfileNopaidId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4"), + Reference = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileNopaidHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileNopaidHistory_ProfileNopaid_ProfileNopaidId", + column: x => x.ProfileNopaidId, + principalTable: "ProfileNopaid", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileOtherHistory", + 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"), + ProfileOtherId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่"), + Detail = table.Column(type: "longtext", nullable: true, comment: "รายละเอียด") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileOtherHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileOtherHistory_ProfileOther_ProfileOtherId", + column: x => x.ProfileOtherId, + principalTable: "ProfileOther", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileSalaryHistory", + 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"), + ProfileSalaryId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Amount = table.Column(type: "double", nullable: true, comment: "เงินเดือน"), + Date = table.Column(type: "datetime(6)", nullable: true, comment: "วัน เดือน ปี รับตำแหน่ง"), + MouthSalaryAmount = table.Column(type: "double", nullable: true, comment: "เงินค่าตอบแทนรายเดือน"), + Oc = table.Column(type: "longtext", nullable: true, comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + OcId = table.Column(type: "char(36)", nullable: true, comment: "Id สังกัด", collation: "ascii_general_ci"), + OrganizationShortName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OrganizationShortNameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PosNo = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PosNoEmployee = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่งลูกจ้าง") + .Annotation("MySql:CharSet", "utf8mb4"), + PosNoId = table.Column(type: "char(36)", nullable: true, comment: "Id เลขที่ตำแหน่ง", collation: "ascii_general_ci"), + Position = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeeGroup = table.Column(type: "longtext", nullable: true, comment: "กลุ่มงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeeGroupId = table.Column(type: "char(36)", nullable: true, comment: "Id กลุ่มงาน", collation: "ascii_general_ci"), + PositionEmployeeLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับชั้นงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeeLevelId = table.Column(type: "char(36)", nullable: true, comment: " Id ระดับชั้นงาน", collation: "ascii_general_ci"), + PositionEmployeePosition = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeePositionId = table.Column(type: "char(36)", nullable: true, comment: "Id ตำแหน่ง", collation: "ascii_general_ci"), + PositionEmployeePositionSide = table.Column(type: "longtext", nullable: true, comment: "ด้านของตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionEmployeePositionSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้านของตำแหน่ง", collation: "ascii_general_ci"), + PositionExecutive = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่งทางการบริหาร") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutiveId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้านทางการบริหาร", collation: "ascii_general_ci"), + PositionExecutiveSide = table.Column(type: "longtext", nullable: true, comment: "ด้านทางการบริหาร") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionExecutiveSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้านทางการบริหาร", collation: "ascii_general_ci"), + PositionId = table.Column(type: "char(36)", nullable: true, comment: "Id ตำแหน่ง", collation: "ascii_general_ci"), + PositionLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับ") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLevelId = table.Column(type: "char(36)", nullable: true, comment: " Id ระดับ", collation: "ascii_general_ci"), + PositionLine = table.Column(type: "longtext", nullable: true, comment: "สายงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLineId = table.Column(type: "char(36)", nullable: true, comment: "Id สายงาน", collation: "ascii_general_ci"), + PositionPathSide = table.Column(type: "longtext", nullable: true, comment: "ด้าน/สาขา") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionPathSideId = table.Column(type: "char(36)", nullable: true, comment: "Id ด้าน/สาขา", collation: "ascii_general_ci"), + PositionSalaryAmount = table.Column(type: "double", nullable: true, comment: "เงินประจำตำแหน่ง"), + PositionType = table.Column(type: "longtext", nullable: true, comment: "ประเภทตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionTypeId = table.Column(type: "char(36)", nullable: true, comment: "Id ประเภทตำแหน่ง", collation: "ascii_general_ci"), + SalaryClass = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง (รายละเอียด)") + .Annotation("MySql:CharSet", "utf8mb4"), + SalaryRef = table.Column(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileSalaryHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileSalaryHistory_ProfileSalary_ProfileSalaryId", + column: x => x.ProfileSalaryId, + principalTable: "ProfileSalary", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ProfileTrainingHistory", + 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"), + ProfileTrainingId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DateOrder = table.Column(type: "datetime(6)", nullable: true, comment: "คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"), + Department = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + Duration = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "รวมระยะเวลาในการฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + EndDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันสิ้นสุดการฝึกอบรม/ดูงาน"), + Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "ชื่อโครงการ/หลักสูตรการฝึกอบรม") + .Annotation("MySql:CharSet", "utf8mb4"), + NumberOrder = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ") + .Annotation("MySql:CharSet", "utf8mb4"), + Place = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "สถานที่ฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + StartDate = table.Column(type: "datetime(6)", nullable: true, comment: "วันเริ่มต้นการฝึกอบรม/ดูงาน"), + Topic = table.Column(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หัวข้อการฝึกอบรม/ดูงาน") + .Annotation("MySql:CharSet", "utf8mb4"), + Yearly = table.Column(type: "int", maxLength: 200, nullable: true, comment: "ปีที่อบรม (พ.ศ.)") + }, + constraints: table => + { + table.PrimaryKey("PK_ProfileTrainingHistory", x => x.Id); + table.ForeignKey( + name: "FK_ProfileTrainingHistory_ProfileTraining_ProfileTrainingId", + column: x => x.ProfileTrainingId, + principalTable: "ProfileTraining", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AvailablePositionLevels_PositionLevelId", + table: "AvailablePositionLevels", + column: "PositionLevelId"); + + migrationBuilder.CreateIndex( + name: "IX_AvailablePositionLevels_PositionMasterId", + table: "AvailablePositionLevels", + column: "PositionMasterId"); + + migrationBuilder.CreateIndex( + name: "IX_Districts_ProvinceId", + table: "Districts", + column: "ProvinceId"); + + migrationBuilder.CreateIndex( + name: "IX_Insignias_InsigniaTypeId", + table: "Insignias", + column: "InsigniaTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_LimitTypeLeave_LimitLeaveId", + table: "LimitTypeLeave", + column: "LimitLeaveId"); + + migrationBuilder.CreateIndex( + name: "IX_LimitTypeLeave_TypeLeaveId", + table: "LimitTypeLeave", + column: "TypeLeaveId"); + + migrationBuilder.CreateIndex( + name: "IX_OrganizationPositions_OrganizationId", + table: "OrganizationPositions", + column: "OrganizationId"); + + migrationBuilder.CreateIndex( + name: "IX_OrganizationPositions_PositionMasterId", + table: "OrganizationPositions", + column: "PositionMasterId"); + + migrationBuilder.CreateIndex( + name: "IX_OrganizationPositions_PositionNumberId", + table: "OrganizationPositions", + column: "PositionNumberId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationFaxId", + table: "Organizations", + column: "OrganizationFaxId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationLevelId", + table: "Organizations", + column: "OrganizationLevelId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationOrganizationId", + table: "Organizations", + column: "OrganizationOrganizationId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationShortNameId", + table: "Organizations", + column: "OrganizationShortNameId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationStatusId", + table: "Organizations", + column: "OrganizationStatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationTelExternalId", + table: "Organizations", + column: "OrganizationTelExternalId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationTelInternalId", + table: "Organizations", + column: "OrganizationTelInternalId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_OrganizationTypeId", + table: "Organizations", + column: "OrganizationTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_ParentId", + table: "Organizations", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasterHistoryEntity_PositionMasterEntityId", + table: "PositionMasterHistoryEntity", + column: "PositionMasterEntityId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasters_PositionExecutiveId", + table: "PositionMasters", + column: "PositionExecutiveId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasters_PositionExecutiveSideId", + table: "PositionMasters", + column: "PositionExecutiveSideId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasters_PositionLineId", + table: "PositionMasters", + column: "PositionLineId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasters_PositionPathId", + table: "PositionMasters", + column: "PositionPathId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasters_PositionPathSideId", + table: "PositionMasters", + column: "PositionPathSideId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasters_PositionStatusId", + table: "PositionMasters", + column: "PositionStatusId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionMasters_PositionTypeId", + table: "PositionMasters", + column: "PositionTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_PositionNumbers_OrganizationShortNameId", + table: "PositionNumbers", + column: "OrganizationShortNameId"); + + migrationBuilder.CreateIndex( + name: "IX_Positions_ExecutiveSideId", + table: "Positions", + column: "ExecutiveSideId"); + + migrationBuilder.CreateIndex( + name: "IX_Positions_PathSideId", + table: "Positions", + column: "PathSideId"); + + migrationBuilder.CreateIndex( + name: "IX_Positions_PositionLevelId", + table: "Positions", + column: "PositionLevelId"); + + migrationBuilder.CreateIndex( + name: "IX_Positions_PositionPathId", + table: "Positions", + column: "PositionPathId"); + + migrationBuilder.CreateIndex( + name: "IX_Positions_PositionTypeId", + table: "Positions", + column: "PositionTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_AvatarId", + table: "Profile", + column: "AvatarId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_GenderId", + table: "Profile", + column: "GenderId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_LimitLeaveId", + table: "Profile", + column: "LimitLeaveId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionEmployeeGroupId", + table: "Profile", + column: "PositionEmployeeGroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionEmployeeLevelId", + table: "Profile", + column: "PositionEmployeeLevelId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionEmployeeLineId", + table: "Profile", + column: "PositionEmployeeLineId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionEmployeePositionId", + table: "Profile", + column: "PositionEmployeePositionId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionEmployeePositionSideId", + table: "Profile", + column: "PositionEmployeePositionSideId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionId", + table: "Profile", + column: "PositionId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionLevelId", + table: "Profile", + column: "PositionLevelId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PositionTypeId", + table: "Profile", + column: "PositionTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PosNoId", + table: "Profile", + column: "PosNoId"); + + migrationBuilder.CreateIndex( + name: "IX_Profile_PrefixId", + table: "Profile", + column: "PrefixId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileAbility_ProfileId", + table: "ProfileAbility", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileAbilityHistory_ProfileAbilityId", + table: "ProfileAbilityHistory", + column: "ProfileAbilityId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileAddressHistory_ProfileId", + table: "ProfileAddressHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileAssessment_ProfileId", + table: "ProfileAssessment", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileAssessmentHistory_ProfileAssessmentId", + table: "ProfileAssessmentHistory", + column: "ProfileAssessmentId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileAvatarHistory_AvatarFileId", + table: "ProfileAvatarHistory", + column: "AvatarFileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileAvatarHistory_ProfileId", + table: "ProfileAvatarHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileCertificate_ProfileId", + table: "ProfileCertificate", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileCertificateHistory_ProfileCertificateId", + table: "ProfileCertificateHistory", + column: "ProfileCertificateId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileChangeName_DocumentId", + table: "ProfileChangeName", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileChangeName_ProfileId", + table: "ProfileChangeName", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileChangeNameHistory_DocumentId", + table: "ProfileChangeNameHistory", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileChangeNameHistory_ProfileChangeNameId", + table: "ProfileChangeNameHistory", + column: "ProfileChangeNameId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileChildren_ProfileId", + table: "ProfileChildren", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileChildrenHistory_ProfileChildrenId", + table: "ProfileChildrenHistory", + column: "ProfileChildrenId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileChildrenHistory_ProfileFamilyHistoryId", + table: "ProfileChildrenHistory", + column: "ProfileFamilyHistoryId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileCoupleHistory_ProfileId", + table: "ProfileCoupleHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileCurrentAddressHistory_ProfileId", + table: "ProfileCurrentAddressHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileDiscipline_ProfileId", + table: "ProfileDiscipline", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileDisciplineHistory_ProfileDisciplineId", + table: "ProfileDisciplineHistory", + column: "ProfileDisciplineId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileDuty_ProfileId", + table: "ProfileDuty", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileDutyHistory_ProfileDutyId", + table: "ProfileDutyHistory", + column: "ProfileDutyId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileEducation_ProfileId", + table: "ProfileEducation", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileEducationHistory_ProfileEducationId", + table: "ProfileEducationHistory", + column: "ProfileEducationId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileEmployment_ProfileId", + table: "ProfileEmployment", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileFamilyHistory_ProfileId", + table: "ProfileFamilyHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileFatherHistory_ProfileId", + table: "ProfileFatherHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileGovernmentHistory_ProfileId", + table: "ProfileGovernmentHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileHistory_ProfileId", + table: "ProfileHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileHonor_ProfileId", + table: "ProfileHonor", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileHonorHistory_ProfileHonorId", + table: "ProfileHonorHistory", + column: "ProfileHonorId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileInsignia_InsigniaId", + table: "ProfileInsignia", + column: "InsigniaId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileInsignia_ProfileId", + table: "ProfileInsignia", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileInsigniaHistory_ProfileInsigniaId", + table: "ProfileInsigniaHistory", + column: "ProfileInsigniaId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileLeave_ProfileId", + table: "ProfileLeave", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileLeave_TypeLeaveId", + table: "ProfileLeave", + column: "TypeLeaveId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileLeaveHistory_ProfileLeaveId", + table: "ProfileLeaveHistory", + column: "ProfileLeaveId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileLeaveHistory_TypeLeaveId", + table: "ProfileLeaveHistory", + column: "TypeLeaveId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileMotherHistory_ProfileId", + table: "ProfileMotherHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileNopaid_ProfileId", + table: "ProfileNopaid", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileNopaidHistory_ProfileNopaidId", + table: "ProfileNopaidHistory", + column: "ProfileNopaidId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileOther_ProfileId", + table: "ProfileOther", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileOtherHistory_ProfileOtherId", + table: "ProfileOtherHistory", + column: "ProfileOtherId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfilePaper_DocumentId", + table: "ProfilePaper", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfilePaper_ProfileId", + table: "ProfilePaper", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfilePositions_OrganizationPositionId", + table: "ProfilePositions", + column: "OrganizationPositionId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfilePositions_ProfileId", + table: "ProfilePositions", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileRegistrationAddressHistory_ProfileId", + table: "ProfileRegistrationAddressHistory", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileSalary_PositionLevelId", + table: "ProfileSalary", + column: "PositionLevelId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileSalary_ProfileId", + table: "ProfileSalary", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileSalaryHistory_ProfileSalaryId", + table: "ProfileSalaryHistory", + column: "ProfileSalaryId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileTraining_ProfileId", + table: "ProfileTraining", + column: "ProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_ProfileTrainingHistory_ProfileTrainingId", + table: "ProfileTrainingHistory", + column: "ProfileTrainingId"); + + migrationBuilder.CreateIndex( + name: "IX_SubDistricts_DistrictId", + table: "SubDistricts", + column: "DistrictId"); + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231220031955_update table DisciplineDisciplinarys add StatusDiscard.Designer.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231220031955_update table DisciplineDisciplinarys add StatusDiscard.Designer.cs new file mode 100644 index 00000000..7b9db205 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231220031955_update table DisciplineDisciplinarys add StatusDiscard.Designer.cs @@ -0,0 +1,2972 @@ +// +using System; +using BMA.EHR.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + [DbContext(typeof(DisciplineDbContext))] + [Migration("20231220031955_update table DisciplineDisciplinarys add StatusDiscard")] + partial class updatetableDisciplineDisciplinarysaddStatusDiscard + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CaseNumber") + .HasColumnType("longtext") + .HasComment("คดีเลขที่"); + + b.Property("CaseType") + .HasColumnType("longtext") + .HasComment("ประเภทคดี"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์"); + + b.Property("Fullname") + .HasColumnType("longtext") + .HasComment("ชื่อ-นามสกุลผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัดผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่งผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("ProfileId") + .HasColumnType("char(36)") + .HasComment("ProfileId"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะอุทธรณ์/ร้องทุกข์"); + + b.Property("Title") + .HasColumnType("text") + .HasComment("เรื่องที่อุทธรณ์/ร้องทุกข์"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ประเภทอุทธรณ์หรือร้องทุกข์"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Appeals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaint_AppealId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineComplaint_Appeal_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_History", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะอุทธรณ์/ร้องทุกข์"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaint_AppealId"); + + b.ToTable("DisciplineComplaint_Appeal_Historys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Channel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อประเภทการร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Channels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineComplaint_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineComplaint_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Email") + .IsRequired() + .HasColumnType("longtext") + .HasComment("อีเมล"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เบอร์โทรศัพท์"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("Prefix") + .IsRequired() + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineDirectors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("longtext") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryCauseText") + .HasColumnType("longtext") + .HasComment("ผลการสอบสวน กรณีมีมูล"); + + b.Property("DisciplinaryDateAllegation") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับทราบข้อกล่าวหา"); + + b.Property("DisciplinaryDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("DisciplinaryDateEvident") + .HasColumnType("datetime(6)") + .HasComment("วันที่สรุปพยานหลักฐาน"); + + b.Property("DisciplinaryDateInvestigation") + .HasColumnType("datetime(6)") + .HasComment("วันที่มีคำสั่งให้สอบสวน"); + + b.Property("DisciplinaryDateResult") + .HasColumnType("datetime(6)") + .HasComment("วันที่รายงานผลการสอบสวน"); + + b.Property("DisciplinaryDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("DisciplinaryDaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่ขยาย"); + + b.Property("DisciplinaryExtendStatus") + .HasColumnType("tinyint(1)") + .HasComment("ขยายเวลา"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("longtext") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplinaryInvestigateAt") + .HasColumnType("longtext") + .HasComment("สอบสวนที่"); + + b.Property("DisciplinaryRecordAccuser") + .HasColumnType("longtext") + .HasComment("บันทึกถ้อยคำของผู้กล่าวหา"); + + b.Property("DisciplinaryRefLaw") + .HasColumnType("longtext") + .HasComment("อ้างอิงมาตราตามกฎหมาย"); + + b.Property("DisciplinaryResult") + .HasColumnType("longtext") + .HasComment("ผลการสอบสวน เหตุผล"); + + b.Property("DisciplinaryStatusResult") + .HasColumnType("longtext") + .HasComment("ผลการสอบสวน ผล"); + + b.Property("DisciplinarySummaryEvidence") + .HasColumnType("longtext") + .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"); + + b.Property("DisciplinaryWitnesses") + .HasColumnType("longtext") + .HasComment("พยานและบันทึกถ้อยคำพยาน"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("tinyint(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("ResultDescription") + .HasColumnType("longtext") + .HasComment("สรุปผลการพิจารณา"); + + b.Property("ResultDisciplineType") + .HasColumnType("longtext") + .HasComment("ประเภทวินัย"); + + b.Property("ResultInvestigate") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องสืบสวน"); + + b.Property("ResultOc") + .HasColumnType("longtext") + .HasComment("หน่วยงาย/ส่วนราชการ"); + + b.Property("ResultTitleType") + .HasColumnType("longtext") + .HasComment("ประเภทของเรื่อง"); + + b.Property("ResultYear") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("int") + .HasComment("ครั้งที่ขยาย"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinaryExtends"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_DirectorInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigateRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocOthers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRecordAccusers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocResults"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocSummaryEvidences"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocWitnessess"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeDiscardId") + .HasColumnType("char(36)") + .HasComment("ประเภทออกคำสั่งงดโทด"); + + b.Property("CommandTypeId") + .HasColumnType("char(36)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("IsReport") + .HasColumnType("tinyint(1)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะออกคำสั่ง"); + + b.Property("StatusDiscard") + .HasColumnType("longtext") + .HasComment("สถานะออกคำสั่งงดโทด"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("tinyint(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("int") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("int") + .HasComment("ครั้งที่ขยาย"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigateExtends"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigateRelevant_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_DocComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("IsReport") + .HasColumnType("tinyint(1)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeId") + .HasColumnType("char(36)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DescriptionSuspend") + .HasColumnType("longtext") + .HasComment("เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน"); + + b.Property("DisciplineDisciplinary_ProfileComplaintInvestigateId") + .HasColumnType("char(36)"); + + b.Property("EndDateSuspend") + .HasColumnType("datetime(6)") + .HasComment("วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.Property("StartDateSuspend") + .HasColumnType("datetime(6)") + .HasComment("วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะออกคำสั่ง"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinary_ProfileComplaintInvestigateId"); + + b.ToTable("DisciplineReport_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("text"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ObjectRefId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("Documents"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal") + .WithMany("DisciplineComplaint_Appeal_Docs") + .HasForeignKey("DisciplineComplaint_AppealId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint_Appeal"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_History", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal") + .WithMany("DisciplineComplaint_Appeal_Historys") + .HasForeignKey("DisciplineComplaint_AppealId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint_Appeal"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Docs") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Profiles") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineDisciplinarys") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinaryExtends") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigateRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocOthers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRecordAccusers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocResults") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocSummaryEvidences") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocWitnessess") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_ProfileComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineInvestigates") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateExtends") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", "DisciplineDisciplinary_ProfileComplaintInvestigate") + .WithMany("DisciplineReport_Profiles") + .HasForeignKey("DisciplineDisciplinary_ProfileComplaintInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Navigation("DisciplineComplaint_Docs"); + + b.Navigation("DisciplineComplaint_Profiles"); + + b.Navigation("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b => + { + b.Navigation("DisciplineComplaint_Appeal_Docs"); + + b.Navigation("DisciplineComplaint_Appeal_Historys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => + { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineDisciplinaryExtends"); + + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocInvestigateRelevants"); + + b.Navigation("DisciplineDisciplinary_DocInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocOthers"); + + b.Navigation("DisciplineDisciplinary_DocRecordAccusers"); + + b.Navigation("DisciplineDisciplinary_DocRelevants"); + + b.Navigation("DisciplineDisciplinary_DocResults"); + + b.Navigation("DisciplineDisciplinary_DocSummaryEvidences"); + + b.Navigation("DisciplineDisciplinary_DocWitnessess"); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Navigation("DisciplineReport_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Navigation("DisciplineDisciplinarys"); + + b.Navigation("DisciplineInvestigateExtends"); + + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231220031955_update table DisciplineDisciplinarys add StatusDiscard.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231220031955_update table DisciplineDisciplinarys add StatusDiscard.cs new file mode 100644 index 00000000..46444a48 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231220031955_update table DisciplineDisciplinarys add StatusDiscard.cs @@ -0,0 +1,43 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + /// + public partial class updatetableDisciplineDisciplinarysaddStatusDiscard : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "CommandTypeDiscardId", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + type: "char(36)", + nullable: true, + comment: "ประเภทออกคำสั่งงดโทด", + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "StatusDiscard", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + type: "longtext", + nullable: true, + comment: "สถานะออกคำสั่งงดโทด") + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "CommandTypeDiscardId", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates"); + + migrationBuilder.DropColumn( + name: "StatusDiscard", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates"); + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs index 5fa8c901..8c68ba0e 100644 --- a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs @@ -1633,6 +1633,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb .HasColumnType("varchar(13)") .HasComment("รหัสบัตรประชาชน"); + b.Property("CommandTypeDiscardId") + .HasColumnType("char(36)") + .HasComment("ประเภทออกคำสั่งงดโทด"); + b.Property("CommandTypeId") .HasColumnType("char(36)") .HasComment("ประเภทออกคำสั่ง"); @@ -1726,6 +1730,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb .HasColumnType("longtext") .HasComment("สถานะออกคำสั่ง"); + b.Property("StatusDiscard") + .HasColumnType("longtext") + .HasComment("สถานะออกคำสั่งงดโทด"); + b.HasKey("Id"); b.HasIndex("DisciplineDisciplinaryId"); @@ -2481,7929 +2489,6 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.ToTable("Documents"); }); - modelBuilder.Entity("BMA.EHR.Domain.Models.Documents.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("text"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("FileSize") - .HasColumnType("int"); - - b.Property("FileType") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("ObjectRefId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("Document"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .HasColumnType("longtext") - .HasComment("ยังไม่ชัวใช้อะไรเป็นkey"); - - b.HasKey("Id"); - - b.ToTable("LimitLeave"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("LimitLeaveId") - .HasColumnType("char(36)"); - - b.Property("NumLeave") - .HasColumnType("double") - .HasComment("จำนวนที่ลาได้"); - - b.Property("TypeLeaveId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("LimitLeaveId"); - - b.HasIndex("TypeLeaveId"); - - b.ToTable("LimitTypeLeave"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Ability") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("AvatarId") - .HasColumnType("char(36)"); - - b.Property("AvatarRef") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)") - .HasComment("วันเกิด"); - - b.Property("BloodGroupId") - .HasColumnType("char(36)") - .HasComment("Id กลุ่มเลือด"); - - b.Property("CitizenId") - .HasMaxLength(13) - .HasColumnType("varchar(13)") - .HasComment("รหัสบัตรประชาชน"); - - b.Property("Couple") - .HasColumnType("tinyint(1)") - .HasComment("คู่สมรส"); - - b.Property("CoupleCareer") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("อาชีพคู่สมรส"); - - b.Property("CoupleCitizenId") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("เลขที่บัตรประชาชนคู่สมรส"); - - b.Property("CoupleFirstName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อคู่สมรส"); - - b.Property("CoupleLastName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุลคู่สมรส"); - - b.Property("CoupleLastNameOld") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุลคู่สมรส(เดิม)"); - - b.Property("CoupleLive") - .HasColumnType("tinyint(1)") - .HasComment("มีชีวิตคู่สมรส"); - - b.Property("CouplePrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้าคู่สมรส"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUser") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("varchar(250)"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("CurrentAddress") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("ที่อยู่ปัจจุบัน"); - - b.Property("CurrentDistrictId") - .HasColumnType("char(36)") - .HasComment("Id เขตปัจจุบัน"); - - b.Property("CurrentProvinceId") - .HasColumnType("char(36)") - .HasComment("Id จังหวัดปัจจุบัน"); - - b.Property("CurrentSubDistrictId") - .HasColumnType("char(36)") - .HasComment("Id แขวงปัจจุบัน"); - - b.Property("CurrentZipCode") - .HasMaxLength(5) - .HasColumnType("varchar(5)") - .HasComment("รหัสไปรษณีย์ปัจจุบัน"); - - b.Property("DateAppoint") - .HasColumnType("datetime(6)"); - - b.Property("DateRetire") - .HasColumnType("datetime(6)"); - - b.Property("DateStart") - .HasColumnType("datetime(6)"); - - b.Property("DutyTimeEffectiveDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่รอบการลงเวลามีผล"); - - b.Property("DutyTimeId") - .HasColumnType("char(36)") - .HasComment("รอบการลงเวลาเข้างาน"); - - b.Property("EmployeeClass") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("ประเภทลูกจ้าง"); - - b.Property("EmployeeMoneyAllowance") - .HasColumnType("double") - .HasComment("เงินช่วยเหลือค่าครองชีพชั่วคราว"); - - b.Property("EmployeeMoneyEmployee") - .HasColumnType("double") - .HasComment("เงินสมทบประกันสังคม(ลูกจ้าง)"); - - b.Property("EmployeeMoneyEmployer") - .HasColumnType("double") - .HasComment("เงินสมทบประกันสังคม(นายจ้าง)"); - - b.Property("EmployeeMoneyIncrease") - .HasColumnType("double") - .HasComment("เงินเพิ่มการครองชีพชั่วคราว"); - - b.Property("EmployeeOc") - .HasColumnType("longtext") - .HasComment("สังกัด"); - - b.Property("EmployeeType") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("ประเภทการจ้าง"); - - b.Property("EmployeeTypeIndividual") - .HasColumnType("longtext") - .HasComment("ประเภทบุคคล"); - - b.Property("EmployeeWage") - .HasColumnType("double") - .HasComment("ค่าจ้าง"); - - b.Property("EntryStatus") - .IsRequired() - .HasMaxLength(5) - .HasColumnType("varchar(5)"); - - b.Property("FatherCareer") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("อาชีพบิดา"); - - b.Property("FatherCitizenId") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("เลขที่บัตรประชาชนบิดา"); - - b.Property("FatherFirstName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อบิดา"); - - b.Property("FatherLastName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุลบิดา"); - - b.Property("FatherLive") - .HasColumnType("tinyint(1)") - .HasComment("มีชีวิตบิดา"); - - b.Property("FatherPrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้าบิดา"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อ"); - - b.Property("FirstNameOld") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อ(เดิม)"); - - b.Property("GenderId") - .HasColumnType("char(36)"); - - b.Property("GovAgeAbsent") - .HasColumnType("int"); - - b.Property("GovAgePlus") - .HasColumnType("int"); - - b.Property("GovernmentCode") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsLeave") - .HasColumnType("tinyint(1)"); - - b.Property("IsProbation") - .HasColumnType("tinyint(1)"); - - b.Property("IsTransfer") - .HasColumnType("tinyint(1)"); - - b.Property("IsVerified") - .HasColumnType("tinyint(1)"); - - b.Property("KeycloakId") - .HasColumnType("char(36)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุล"); - - b.Property("LastNameOld") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุล(เดิม)"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("LeaveDate") - .HasColumnType("datetime(6)"); - - b.Property("LeaveDateOrder") - .HasColumnType("datetime(6)"); - - b.Property("LeaveDetail") - .HasColumnType("longtext"); - - b.Property("LeaveNumberOrder") - .HasColumnType("longtext"); - - b.Property("LeaveReason") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)"); - - b.Property("LimitLeaveId") - .HasColumnType("char(36)"); - - b.Property("ModifiedDate") - .HasColumnType("datetime(6)"); - - b.Property("MotherCareer") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("อาชีพมารดา"); - - b.Property("MotherCitizenId") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("เลขที่บัตรประชาชนมารดา"); - - b.Property("MotherFirstName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อมารดา"); - - b.Property("MotherLastName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุลมารดา"); - - b.Property("MotherLive") - .HasColumnType("tinyint(1)") - .HasComment("มีชีวิตมารดา"); - - b.Property("MotherPrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้ามารดา"); - - b.Property("Nationality") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("สัญชาติ"); - - b.Property("Oc") - .HasColumnType("longtext") - .HasComment("สังกัด"); - - b.Property("OcId") - .HasColumnType("char(36)") - .HasComment("Id สังกัด"); - - b.Property("OrganizationOrganization") - .HasColumnType("longtext"); - - b.Property("OrganizationOrganizationId") - .HasColumnType("char(36)"); - - b.Property("OrganizationShortName") - .HasColumnType("longtext"); - - b.Property("OrganizationShortNameId") - .HasColumnType("char(36)"); - - b.Property("Physical") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("สถานภาพทางกาย"); - - b.Property("PosNoEmployee") - .HasColumnType("longtext") - .HasComment("เลขที่ตำแหน่งลูกจ้าง"); - - b.Property("PosNoId") - .HasColumnType("char(36)"); - - b.Property("PositionEmployeeGroupId") - .HasColumnType("char(36)"); - - b.Property("PositionEmployeeLevelId") - .HasColumnType("char(36)"); - - b.Property("PositionEmployeeLineId") - .HasColumnType("char(36)"); - - b.Property("PositionEmployeePositionId") - .HasColumnType("char(36)"); - - b.Property("PositionEmployeePositionSideId") - .HasColumnType("char(36)"); - - b.Property("PositionExecutive") - .HasColumnType("longtext") - .HasComment("ตำแหน่งทางการบริหาร"); - - b.Property("PositionExecutiveId") - .HasColumnType("char(36)") - .HasComment("Id ตำแหน่งทางการบริหาร"); - - b.Property("PositionExecutiveSide") - .HasColumnType("longtext") - .HasComment("ด้านทางการบริหาร"); - - b.Property("PositionExecutiveSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้านทางการบริหาร"); - - b.Property("PositionId") - .HasColumnType("char(36)"); - - b.Property("PositionLevelId") - .HasColumnType("char(36)"); - - b.Property("PositionLine") - .HasColumnType("longtext") - .HasComment("สายงาน"); - - b.Property("PositionLineId") - .HasColumnType("char(36)") - .HasComment("Id สายงาน"); - - b.Property("PositionPathSide") - .HasColumnType("longtext") - .HasComment("ด้าน/สาขา"); - - b.Property("PositionPathSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้าน/สาขา"); - - b.Property("PositionTypeId") - .HasColumnType("char(36)"); - - b.Property("PrefixId") - .HasColumnType("char(36)"); - - b.Property("PrefixOldId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้า(เดิม)"); - - b.Property("ProfileType") - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.Property("Race") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("เชื้อชาติ"); - - b.Property("ReasonSameDate") - .HasColumnType("longtext"); - - b.Property("RegistrationAddress") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("Id แขวงตามทะเบียนบ้าน"); - - b.Property("RegistrationDistrictId") - .HasColumnType("char(36)") - .HasComment("Id เขตตามทะเบียนบ้าน"); - - b.Property("RegistrationProvinceId") - .HasColumnType("char(36)") - .HasComment("Id จังหวัดตามทะเบียนบ้าน"); - - b.Property("RegistrationSame") - .HasColumnType("tinyint(1)") - .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); - - b.Property("RegistrationSubDistrictId") - .HasColumnType("char(36)") - .HasComment("แขวงตามทะเบียนบ้าน"); - - b.Property("RegistrationZipCode") - .HasMaxLength(5) - .HasColumnType("varchar(5)") - .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); - - b.Property("RelationshipId") - .HasColumnType("char(36)") - .HasComment("Id สถานะภาพ"); - - b.Property("ReligionId") - .HasColumnType("char(36)") - .HasComment("Id ศาสนา"); - - b.Property("TelephoneNumber") - .HasMaxLength(50) - .HasColumnType("varchar(50)") - .HasComment("เบอร์โทร"); - - b.Property("TransferDate") - .HasColumnType("datetime(6)"); - - b.Property("VerifiedDate") - .HasColumnType("datetime(6)"); - - b.Property("VerifiedUser") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("AvatarId"); - - b.HasIndex("GenderId"); - - b.HasIndex("LimitLeaveId"); - - b.HasIndex("PosNoId"); - - b.HasIndex("PositionEmployeeGroupId"); - - b.HasIndex("PositionEmployeeLevelId"); - - b.HasIndex("PositionEmployeeLineId"); - - b.HasIndex("PositionEmployeePositionId"); - - b.HasIndex("PositionEmployeePositionSideId"); - - b.HasIndex("PositionId"); - - b.HasIndex("PositionLevelId"); - - b.HasIndex("PositionTypeId"); - - b.HasIndex("PrefixId"); - - b.ToTable("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateEnd") - .HasColumnType("datetime(6)") - .HasComment("วันที่สิ้นสุด"); - - b.Property("DateStart") - .HasColumnType("datetime(6)") - .HasComment("วันที่เริ่มต้น"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("Field") - .HasColumnType("longtext") - .HasComment("ด้าน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.Property("Remark") - .HasColumnType("longtext") - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileAbility"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateEnd") - .HasColumnType("datetime(6)") - .HasComment("วันที่สิ้นสุด"); - - b.Property("DateStart") - .HasColumnType("datetime(6)") - .HasComment("วันที่เริ่มต้น"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("Field") - .HasColumnType("longtext") - .HasComment("ด้าน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileAbilityId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.Property("Remark") - .HasColumnType("longtext") - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.HasIndex("ProfileAbilityId"); - - b.ToTable("ProfileAbilityHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("CurrentAddress") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("ที่อยู่ปัจจุบัน"); - - b.Property("CurrentDistrict") - .HasColumnType("longtext") - .HasComment("เขตปัจจุบัน"); - - b.Property("CurrentDistrictId") - .HasColumnType("char(36)") - .HasComment("Id เขตปัจจุบัน"); - - b.Property("CurrentProvince") - .HasColumnType("longtext") - .HasComment("จังหวัดปัจจุบัน"); - - b.Property("CurrentProvinceId") - .HasColumnType("char(36)") - .HasComment("Id จังหวัดปัจจุบัน"); - - b.Property("CurrentSubDistrict") - .HasColumnType("longtext") - .HasComment("แขวงปัจจุบัน"); - - b.Property("CurrentSubDistrictId") - .HasColumnType("char(36)") - .HasComment("Id แขวงปัจจุบัน"); - - b.Property("CurrentZipCode") - .HasMaxLength(5) - .HasColumnType("varchar(5)") - .HasComment("รหัสไปรษณีย์ปัจจุบัน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("RegistrationAddress") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("ที่อยู่ตามทะเบียนบ้าน"); - - b.Property("RegistrationDistrict") - .HasColumnType("longtext") - .HasComment("เขตตามทะเบียนบ้าน"); - - b.Property("RegistrationDistrictId") - .HasColumnType("char(36)") - .HasComment("Id เขตตามทะเบียนบ้าน"); - - b.Property("RegistrationProvince") - .HasColumnType("longtext") - .HasComment("จังหวัดตามทะเบียนบ้าน"); - - b.Property("RegistrationProvinceId") - .HasColumnType("char(36)") - .HasComment("Id จังหวัดตามทะเบียนบ้าน"); - - b.Property("RegistrationSame") - .HasColumnType("tinyint(1)") - .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); - - b.Property("RegistrationSubDistrict") - .HasColumnType("longtext") - .HasComment("แขวงตามทะเบียนบ้าน"); - - b.Property("RegistrationSubDistrictId") - .HasColumnType("char(36)") - .HasComment("Id แขวงตามทะเบียนบ้าน"); - - b.Property("RegistrationZipCode") - .HasMaxLength(5) - .HasColumnType("varchar(5)") - .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileAddressHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วันที่ได้รับ"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .HasColumnType("longtext") - .HasComment("ชื่อแบบประเมิน"); - - b.Property("Point1") - .HasColumnType("double") - .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); - - b.Property("Point1Total") - .HasColumnType("double") - .HasComment("ส่วนที่1 (คะแนน)"); - - b.Property("Point2") - .HasColumnType("double") - .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); - - b.Property("Point2Total") - .HasColumnType("double") - .HasComment("ส่วนที่2 (คะแนน)"); - - b.Property("PointSum") - .HasColumnType("double") - .HasComment("ผลประเมินรวม (คะแนน)"); - - b.Property("PointSumTotal") - .HasColumnType("double") - .HasComment("ผลรวม (คะแนน)"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileAssessment"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วันที่ได้รับ"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .HasColumnType("longtext") - .HasComment("ชื่อแบบประเมิน"); - - b.Property("Point1") - .HasColumnType("double") - .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); - - b.Property("Point1Total") - .HasColumnType("double") - .HasComment("ส่วนที่1 (คะแนน)"); - - b.Property("Point2") - .HasColumnType("double") - .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); - - b.Property("Point2Total") - .HasColumnType("double") - .HasComment("ส่วนที่2 (คะแนน)"); - - b.Property("PointSum") - .HasColumnType("double") - .HasComment("ผลประเมินรวม (คะแนน)"); - - b.Property("PointSumTotal") - .HasColumnType("double") - .HasComment("ผลรวม (คะแนน)"); - - b.Property("ProfileAssessmentId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileAssessmentId"); - - b.ToTable("ProfileAssessmentHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AvatarFileId") - .HasColumnType("char(36)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("AvatarFileId"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileAvatarHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CertificateNo") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("เลขที่ใบอนุญาต"); - - b.Property("CertificateType") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อใบอนุญาต"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("ExpireDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่หมดอายุ"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IssueDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่ออกใบอนุญาต"); - - b.Property("Issuer") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หน่วยงานผู้ออกใบอนุญาต"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileCertificate"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CertificateNo") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("เลขที่ใบอนุญาต"); - - b.Property("CertificateType") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อใบอนุญาต"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("ExpireDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่หมดอายุ"); - - b.Property("IssueDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่ออกใบอนุญาต"); - - b.Property("Issuer") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หน่วยงานผู้ออกใบอนุญาต"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileCertificateId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileCertificateId"); - - b.ToTable("ProfileCertificateHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DocumentId") - .HasColumnType("char(36)"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อ"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Prefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้า"); - - b.Property("PrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้า"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("Status") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("สถานะ"); - - b.HasKey("Id"); - - b.HasIndex("DocumentId"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileChangeName"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DocumentId") - .HasColumnType("char(36)"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อ"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Prefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้า"); - - b.Property("PrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้า"); - - b.Property("ProfileChangeNameId") - .HasColumnType("char(36)"); - - b.Property("Status") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("สถานะ"); - - b.HasKey("Id"); - - b.HasIndex("DocumentId"); - - b.HasIndex("ProfileChangeNameId"); - - b.ToTable("ProfileChangeNameHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ChildrenCareer") - .HasColumnType("longtext") - .HasComment("อาชีพบุตร"); - - b.Property("ChildrenFirstName") - .HasColumnType("longtext") - .HasComment("ชื่อบุตร"); - - b.Property("ChildrenLastName") - .HasColumnType("longtext") - .HasComment("นามสกุลบุตร"); - - b.Property("ChildrenPrefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้าบุตร"); - - b.Property("ChildrenPrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้าบุตร"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileChildren"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ChildrenCareer") - .HasColumnType("longtext") - .HasComment("อาชีพบุตร"); - - b.Property("ChildrenFirstName") - .HasColumnType("longtext") - .HasComment("ชื่อบุตร"); - - b.Property("ChildrenLastName") - .HasColumnType("longtext") - .HasComment("นามสกุลบุตร"); - - b.Property("ChildrenPrefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้าบุตร"); - - b.Property("ChildrenPrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้าบุตร"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileChildrenId") - .HasColumnType("char(36)"); - - b.Property("ProfileFamilyHistoryId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileChildrenId"); - - b.HasIndex("ProfileFamilyHistoryId"); - - b.ToTable("ProfileChildrenHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasComment("ไม่ใช้"); - - b.Property("Career") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Prefix") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileCoupleHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasComment("ไม่ใช้"); - - b.Property("Address") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("DistrictId") - .HasColumnType("char(36)"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("ProvinceId") - .HasColumnType("char(36)"); - - b.Property("SubDistrictId") - .HasColumnType("char(36)"); - - b.Property("ZipCode") - .IsRequired() - .HasMaxLength(5) - .HasColumnType("varchar(5)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileCurrentAddressHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี"); - - b.Property("Detail") - .HasColumnType("text") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Level") - .HasColumnType("longtext") - .HasComment("ระดับความผิด"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("RefCommandDate") - .HasColumnType("datetime(6)") - .HasComment("เอกสารอ้างอิง (ลงวันที่)"); - - b.Property("RefCommandNo") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileDiscipline"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี"); - - b.Property("Detail") - .HasColumnType("text") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Level") - .HasColumnType("longtext") - .HasComment("ระดับความผิด"); - - b.Property("ProfileDisciplineId") - .HasColumnType("char(36)"); - - b.Property("RefCommandDate") - .HasColumnType("datetime(6)") - .HasComment("เอกสารอ้างอิง (ลงวันที่)"); - - b.Property("RefCommandNo") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileDisciplineId"); - - b.ToTable("ProfileDisciplineHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateEnd") - .HasColumnType("datetime(6)") - .HasComment("สิ้นสุด"); - - b.Property("DateStart") - .HasColumnType("datetime(6)") - .HasComment("เริ่มต้น"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileDuty"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateEnd") - .HasColumnType("datetime(6)") - .HasComment("สิ้นสุด"); - - b.Property("DateStart") - .HasColumnType("datetime(6)") - .HasComment("เริ่มต้น"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileDutyId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.HasKey("Id"); - - b.HasIndex("ProfileDutyId"); - - b.ToTable("ProfileDutyHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Country") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ประเทศ"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Degree") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("วุฒิการศึกษา"); - - b.Property("Duration") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ระยะเวลา"); - - b.Property("DurationYear") - .HasColumnType("int") - .HasComment("ระยะเวลาหลักสูตร"); - - b.Property("EducationLevel") - .HasColumnType("longtext") - .HasComment("ระดับศึกษา"); - - b.Property("EducationLevelId") - .HasColumnType("char(36)") - .HasComment("Id ระดับศึกษา"); - - b.Property("EndDate") - .HasColumnType("datetime(6)") - .HasComment("ถึง"); - - b.Property("Field") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("สาขาวิชา/ทาง"); - - b.Property("FinishDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่สำเร็จการศึกษา"); - - b.Property("FundName") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ทุน"); - - b.Property("Gpa") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("เกรดเฉลี่ย"); - - b.Property("Institute") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("สถานศึกษา"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Other") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ข้อมูลการติดต่อ"); - - b.Property("PositionPath") - .HasColumnType("longtext") - .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); - - b.Property("PositionPathId") - .HasColumnType("char(36)") - .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("StartDate") - .HasColumnType("datetime(6)") - .HasComment("ตั้งแต่"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileEducation"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Country") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ประเทศ"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Degree") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("วุฒิการศึกษา"); - - b.Property("Duration") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ระยะเวลา"); - - b.Property("DurationYear") - .HasColumnType("int") - .HasComment("ระยะเวลาหลักสูตร"); - - b.Property("EducationLevel") - .HasColumnType("longtext") - .HasComment("ระดับศึกษา"); - - b.Property("EducationLevelId") - .HasColumnType("char(36)") - .HasComment("Id ระดับศึกษา"); - - b.Property("EndDate") - .HasColumnType("datetime(6)") - .HasComment("ถึง"); - - b.Property("Field") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("สาขาวิชา/ทาง"); - - b.Property("FinishDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่สำเร็จการศึกษา"); - - b.Property("FundName") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ทุน"); - - b.Property("Gpa") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("เกรดเฉลี่ย"); - - b.Property("Institute") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("สถานศึกษา"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Other") - .HasMaxLength(1000) - .HasColumnType("varchar(1000)") - .HasComment("ข้อมูลการติดต่อ"); - - b.Property("PositionPath") - .HasColumnType("longtext") - .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); - - b.Property("PositionPathId") - .HasColumnType("char(36)") - .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); - - b.Property("ProfileEducationId") - .HasColumnType("char(36)"); - - b.Property("StartDate") - .HasColumnType("datetime(6)") - .HasComment("ตั้งแต่"); - - b.HasKey("Id"); - - b.HasIndex("ProfileEducationId"); - - b.ToTable("ProfileEducationHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Command") - .HasColumnType("longtext") - .HasComment("คำสั่ง"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วันที่จ้าง"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileEmployment"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Couple") - .HasColumnType("tinyint(1)") - .HasComment("คู่สมรส"); - - b.Property("CoupleCareer") - .HasColumnType("longtext") - .HasComment("อาชีพคู่สมรส"); - - b.Property("CoupleFirstName") - .HasColumnType("longtext") - .HasComment("ชื่อคู่สมรส"); - - b.Property("CoupleLastName") - .HasColumnType("longtext") - .HasComment("นามสกุลคู่สมรส"); - - b.Property("CoupleLastNameOld") - .HasColumnType("longtext") - .HasComment("นามสกุลคู่สมรส(เดิม)"); - - b.Property("CouplePrefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้าคู่สมรส"); - - b.Property("CouplePrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้าคู่สมรส"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("FatherCareer") - .HasColumnType("longtext") - .HasComment("อาชีพบิดา"); - - b.Property("FatherFirstName") - .HasColumnType("longtext") - .HasComment("ชื่อบิดา"); - - b.Property("FatherLastName") - .HasColumnType("longtext") - .HasComment("นามสกุลบิดา"); - - b.Property("FatherPrefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้าบิดา"); - - b.Property("FatherPrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้าบิดา"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("MotherCareer") - .HasColumnType("longtext") - .HasComment("อาชีพมารดา"); - - b.Property("MotherFirstName") - .HasColumnType("longtext") - .HasComment("ชื่อมารดา"); - - b.Property("MotherLastName") - .HasColumnType("longtext") - .HasComment("นามสกุลมารดา"); - - b.Property("MotherPrefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้ามารดา"); - - b.Property("MotherPrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้ามารดา"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileFamilyHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasComment("ไม่ใช้"); - - b.Property("Career") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Prefix") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileFatherHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateAppoint") - .HasColumnType("datetime(6)") - .HasComment("วันที่สั่งบรรจุ"); - - b.Property("DateStart") - .HasColumnType("datetime(6)") - .HasComment("เริ่มปฎิบัติราชการ"); - - b.Property("GovAge") - .HasColumnType("longtext") - .HasComment("อายุราชการ"); - - b.Property("GovAgeAbsent") - .HasColumnType("int") - .HasComment("ขาดราชการ"); - - b.Property("GovAgePlus") - .HasColumnType("int") - .HasComment("อายุราชการเกื้อกูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Oc") - .HasColumnType("longtext") - .HasComment("สังกัด"); - - b.Property("OcId") - .HasColumnType("char(36)") - .HasComment("Id สังกัด"); - - b.Property("PosNo") - .HasColumnType("longtext") - .HasComment("เลขที่ตำแหน่ง"); - - b.Property("PosNoId") - .HasColumnType("char(36)") - .HasComment("Id เลขที่ตำแหน่ง"); - - b.Property("Position") - .HasColumnType("longtext") - .HasComment("ตำแหน่ง"); - - b.Property("PositionEmployeeGroup") - .HasColumnType("longtext") - .HasComment("กลุ่มงาน"); - - b.Property("PositionEmployeeLevel") - .HasColumnType("longtext") - .HasComment("ระดับชั้นงาน"); - - b.Property("PositionEmployeePosition") - .HasColumnType("longtext") - .HasComment("ตำแหน่ง"); - - b.Property("PositionEmployeePositionSide") - .HasColumnType("longtext") - .HasComment("ด้านของตำแหน่ง"); - - b.Property("PositionExecutive") - .HasColumnType("longtext") - .HasComment("ตำแหน่งทางการบริหาร"); - - b.Property("PositionId") - .HasColumnType("char(36)") - .HasComment("Id ตำแหน่ง"); - - b.Property("PositionLevel") - .HasColumnType("longtext") - .HasComment("ระดับตำแหน่ง"); - - b.Property("PositionLine") - .HasColumnType("longtext") - .HasComment("สายงาน"); - - b.Property("PositionType") - .HasColumnType("longtext") - .HasComment("ประเภทตำแหน่ง"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("ReasonSameDate") - .HasColumnType("longtext") - .HasComment("เหตุผลกรณีไม่ตรงวัน"); - - b.Property("RetireDate") - .HasColumnType("longtext") - .HasComment("วันเกษียณอายุ"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileGovernmentHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)") - .HasComment("วันเกิด"); - - b.Property("BloodGroup") - .HasColumnType("longtext") - .HasComment("กลุ่มเลือด"); - - b.Property("BloodGroupId") - .HasColumnType("char(36)") - .HasComment("Id กลุ่มเลือด"); - - b.Property("CitizenId") - .HasMaxLength(13) - .HasColumnType("varchar(13)") - .HasComment("รหัสบัตรประชาชน"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("EmployeeClass") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("ประเภทลูกจ้าง"); - - b.Property("EmployeeType") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("ประเภทการจ้าง"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("ชื่อ"); - - b.Property("Gender") - .HasColumnType("longtext") - .HasComment("เพศ"); - - b.Property("GenderId") - .HasColumnType("char(36)") - .HasComment("Id เพศ"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("นามสกุล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Nationality") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("สัญชาติ"); - - b.Property("Prefix") - .HasColumnType("longtext") - .HasComment("คำนำหน้า"); - - b.Property("PrefixId") - .HasColumnType("char(36)") - .HasComment("Id คำนำหน้า"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("Race") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasComment("เชื้อชาติ"); - - b.Property("Relationship") - .HasColumnType("longtext") - .HasComment("สถานะภาพ"); - - b.Property("RelationshipId") - .HasColumnType("char(36)") - .HasComment("Id สถานะภาพ"); - - b.Property("Religion") - .HasColumnType("longtext") - .HasComment("ศาสนา"); - - b.Property("ReligionId") - .HasColumnType("char(36)") - .HasComment("Id ศาสนา"); - - b.Property("TelephoneNumber") - .HasMaxLength(50) - .HasColumnType("varchar(50)") - .HasComment("เบอร์โทร"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Detail") - .HasMaxLength(2000) - .HasColumnType("varchar(2000)") - .HasComment("รายละเอียด"); - - b.Property("IssueDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่ได้รับ"); - - b.Property("Issuer") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หน่วยงานที่ออก"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileHonor"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Detail") - .HasMaxLength(2000) - .HasColumnType("varchar(2000)") - .HasComment("รายละเอียด"); - - b.Property("IssueDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่ได้รับ"); - - b.Property("Issuer") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หน่วยงานที่ออก"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileHonorId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileHonorId"); - - b.ToTable("ProfileHonorHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateAnnounce") - .HasColumnType("datetime(6)") - .HasComment("วันที่ประกาศในราชกิจจาฯ"); - - b.Property("InsigniaId") - .HasColumnType("char(36)"); - - b.Property("InsigniaType") - .HasColumnType("longtext") - .HasComment("ประเภท"); - - b.Property("Issue") - .HasMaxLength(300) - .HasColumnType("varchar(300)") - .HasComment("ราชกิจจาฯ ฉบับที่"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("No") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("ลำดับที่"); - - b.Property("Page") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("หน้า"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("ReceiveDate") - .HasColumnType("datetime(6)") - .HasComment("ลงวันที่"); - - b.Property("RefCommandDate") - .HasColumnType("datetime(6)") - .HasComment("เอกสารอ้างอิง (ลงวันที่)"); - - b.Property("RefCommandNo") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); - - b.Property("Section") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("ตอน"); - - b.Property("Volume") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("เล่ม"); - - b.Property("VolumeNo") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("เล่มที่"); - - b.Property("Year") - .HasColumnType("int") - .HasComment("ปีที่ยื่นขอ"); - - b.HasKey("Id"); - - b.HasIndex("InsigniaId"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileInsignia"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateAnnounce") - .HasColumnType("datetime(6)") - .HasComment("วันที่ประกาศในราชกิจจาฯ"); - - b.Property("Insignia") - .HasColumnType("longtext") - .HasComment("ชื่อเครื่องราชฯ"); - - b.Property("InsigniaId") - .HasColumnType("char(36)"); - - b.Property("InsigniaType") - .HasColumnType("longtext") - .HasComment("ประเภท"); - - b.Property("Issue") - .HasMaxLength(300) - .HasColumnType("varchar(300)") - .HasComment("ราชกิจจาฯ ฉบับที่"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("No") - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasComment("ลำดับที่"); - - b.Property("Page") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("หน้า"); - - b.Property("ProfileInsigniaId") - .HasColumnType("char(36)"); - - b.Property("ReceiveDate") - .HasColumnType("datetime(6)") - .HasComment("ลงวันที่"); - - b.Property("Section") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("ตอน"); - - b.Property("Volume") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("เล่ม"); - - b.Property("VolumeNo") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasComment("เล่มที่"); - - b.Property("Year") - .HasColumnType("int") - .HasComment("ปีที่ยื่นขอ"); - - b.HasKey("Id"); - - b.HasIndex("ProfileInsigniaId"); - - b.ToTable("ProfileInsigniaHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateEndLeave") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); - - b.Property("DateStartLeave") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี ที่เริ่มลา"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("NumLeave") - .HasColumnType("double") - .HasComment("ลาครั้งที่"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("Reason") - .HasColumnType("longtext") - .HasComment("เหตุผล"); - - b.Property("Status") - .HasColumnType("longtext") - .HasComment("สถานะ"); - - b.Property("SumLeave") - .HasColumnType("double") - .HasComment("ลามาแล้ว"); - - b.Property("TotalLeave") - .HasColumnType("double") - .HasComment("รวมเป็น"); - - b.Property("TypeLeaveId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.HasIndex("TypeLeaveId"); - - b.ToTable("ProfileLeave"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateEndLeave") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); - - b.Property("DateStartLeave") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี ที่เริ่มลา"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("NumLeave") - .HasColumnType("double") - .HasComment("ลาครั้งที่"); - - b.Property("ProfileLeaveId") - .HasColumnType("char(36)"); - - b.Property("Reason") - .HasColumnType("longtext") - .HasComment("เหตุผล"); - - b.Property("Status") - .HasColumnType("longtext") - .HasComment("สถานะ"); - - b.Property("SumLeave") - .HasColumnType("double") - .HasComment("ลามาแล้ว"); - - b.Property("TotalLeave") - .HasColumnType("double") - .HasComment("รวมเป็น"); - - b.Property("TypeLeaveId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileLeaveId"); - - b.HasIndex("TypeLeaveId"); - - b.ToTable("ProfileLeaveHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasComment("ไม่ใช้"); - - b.Property("Career") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Prefix") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileMotherHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileNopaid"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileNopaidId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.HasKey("Id"); - - b.HasIndex("ProfileNopaidId"); - - b.ToTable("ProfileNopaidHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วันที่"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileOther"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วันที่"); - - b.Property("Detail") - .HasColumnType("longtext") - .HasComment("รายละเอียด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileOtherId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileOtherId"); - - b.ToTable("ProfileOtherHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CategoryName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("varchar(255)") - .HasComment("ประเภทไฟล์-ไม่ใช้"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("varchar(255)") - .HasComment("ชื่อไฟล์"); - - b.Property("DocumentId") - .HasColumnType("char(36)"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("DocumentId"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfilePaper"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasComment("ไม่ใช้"); - - b.Property("Address") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("DistrictId") - .HasColumnType("char(36)"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("ProvinceId") - .HasColumnType("char(36)"); - - b.Property("SubDistrictId") - .HasColumnType("char(36)"); - - b.Property("ZipCode") - .IsRequired() - .HasMaxLength(5) - .HasColumnType("varchar(5)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileRegistrationAddressHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Amount") - .HasColumnType("double") - .HasComment("เงินเดือน"); - - b.Property("CommandNo") - .IsRequired() - .HasColumnType("longtext") - .HasComment("เลขที่คำสั่ง"); - - b.Property("CommandTypeName") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ประเภทคำสั่ง"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี รับตำแหน่ง"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("MouthSalaryAmount") - .HasColumnType("double") - .HasComment("เงินค่าตอบแทนรายเดือน"); - - b.Property("OcId") - .HasColumnType("char(36)") - .HasComment("Id สังกัด"); - - b.Property("Order") - .HasColumnType("int") - .HasComment("ลำดับ"); - - b.Property("OrganizationShortNameId") - .HasColumnType("char(36)") - .HasComment("Id ชื่อย่อหน่วยงาน"); - - b.Property("PosNoEmployee") - .HasColumnType("longtext") - .HasComment("เลขที่ตำแหน่งลูกจ้าง"); - - b.Property("PosNoId") - .HasColumnType("char(36)") - .HasComment("Id เลขที่ตำแหน่ง"); - - b.Property("PositionEmployeeGroupId") - .HasColumnType("char(36)") - .HasComment("Id กลุ่มงาน"); - - b.Property("PositionEmployeeLevelId") - .HasColumnType("char(36)") - .HasComment(" Id ระดับชั้นงาน"); - - b.Property("PositionEmployeePositionId") - .HasColumnType("char(36)") - .HasComment("Id ตำแหน่ง"); - - b.Property("PositionEmployeePositionSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้านของตำแหน่ง"); - - b.Property("PositionExecutiveId") - .HasColumnType("char(36)") - .HasComment("Id ตำแหน่งทางการบริหาร"); - - b.Property("PositionExecutiveSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้านทางการบริหาร"); - - b.Property("PositionId") - .HasColumnType("char(36)") - .HasComment("Id ตำแหน่ง"); - - b.Property("PositionLevelId") - .HasColumnType("char(36)"); - - b.Property("PositionLineId") - .HasColumnType("char(36)") - .HasComment("Id สายงาน"); - - b.Property("PositionPathSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้าน/สาขา"); - - b.Property("PositionSalaryAmount") - .HasColumnType("double") - .HasComment("เงินประจำตำแหน่ง"); - - b.Property("PositionTypeId") - .HasColumnType("char(36)") - .HasComment("Id ประเภทตำแหน่ง"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("RefCommandNo") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); - - b.Property("SalaryClass") - .HasColumnType("longtext") - .HasComment("ตำแหน่ง (รายละเอียด)"); - - b.Property("SalaryRef") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.Property("SalaryStatus") - .HasColumnType("longtext") - .HasComment("ประเภทตำแหน่งกรณีพิเศษ"); - - b.HasKey("Id"); - - b.HasIndex("PositionLevelId"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileSalary"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Amount") - .HasColumnType("double") - .HasComment("เงินเดือน"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Date") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปี รับตำแหน่ง"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("MouthSalaryAmount") - .HasColumnType("double") - .HasComment("เงินค่าตอบแทนรายเดือน"); - - b.Property("Oc") - .HasColumnType("longtext") - .HasComment("สังกัด"); - - b.Property("OcId") - .HasColumnType("char(36)") - .HasComment("Id สังกัด"); - - b.Property("OrganizationShortName") - .HasColumnType("longtext"); - - b.Property("OrganizationShortNameId") - .HasColumnType("char(36)"); - - b.Property("PosNo") - .HasColumnType("longtext") - .HasComment("เลขที่ตำแหน่ง"); - - b.Property("PosNoEmployee") - .HasColumnType("longtext") - .HasComment("เลขที่ตำแหน่งลูกจ้าง"); - - b.Property("PosNoId") - .HasColumnType("char(36)") - .HasComment("Id เลขที่ตำแหน่ง"); - - b.Property("Position") - .HasColumnType("longtext") - .HasComment("ตำแหน่ง"); - - b.Property("PositionEmployeeGroup") - .HasColumnType("longtext") - .HasComment("กลุ่มงาน"); - - b.Property("PositionEmployeeGroupId") - .HasColumnType("char(36)") - .HasComment("Id กลุ่มงาน"); - - b.Property("PositionEmployeeLevel") - .HasColumnType("longtext") - .HasComment("ระดับชั้นงาน"); - - b.Property("PositionEmployeeLevelId") - .HasColumnType("char(36)") - .HasComment(" Id ระดับชั้นงาน"); - - b.Property("PositionEmployeePosition") - .HasColumnType("longtext") - .HasComment("ตำแหน่ง"); - - b.Property("PositionEmployeePositionId") - .HasColumnType("char(36)") - .HasComment("Id ตำแหน่ง"); - - b.Property("PositionEmployeePositionSide") - .HasColumnType("longtext") - .HasComment("ด้านของตำแหน่ง"); - - b.Property("PositionEmployeePositionSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้านของตำแหน่ง"); - - b.Property("PositionExecutive") - .HasColumnType("longtext") - .HasComment("ตำแหน่งทางการบริหาร"); - - b.Property("PositionExecutiveId") - .HasColumnType("char(36)") - .HasComment("Id ด้านทางการบริหาร"); - - b.Property("PositionExecutiveSide") - .HasColumnType("longtext") - .HasComment("ด้านทางการบริหาร"); - - b.Property("PositionExecutiveSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้านทางการบริหาร"); - - b.Property("PositionId") - .HasColumnType("char(36)") - .HasComment("Id ตำแหน่ง"); - - b.Property("PositionLevel") - .HasColumnType("longtext") - .HasComment("ระดับ"); - - b.Property("PositionLevelId") - .HasColumnType("char(36)") - .HasComment(" Id ระดับ"); - - b.Property("PositionLine") - .HasColumnType("longtext") - .HasComment("สายงาน"); - - b.Property("PositionLineId") - .HasColumnType("char(36)") - .HasComment("Id สายงาน"); - - b.Property("PositionPathSide") - .HasColumnType("longtext") - .HasComment("ด้าน/สาขา"); - - b.Property("PositionPathSideId") - .HasColumnType("char(36)") - .HasComment("Id ด้าน/สาขา"); - - b.Property("PositionSalaryAmount") - .HasColumnType("double") - .HasComment("เงินประจำตำแหน่ง"); - - b.Property("PositionType") - .HasColumnType("longtext") - .HasComment("ประเภทตำแหน่ง"); - - b.Property("PositionTypeId") - .HasColumnType("char(36)") - .HasComment("Id ประเภทตำแหน่ง"); - - b.Property("ProfileSalaryId") - .HasColumnType("char(36)"); - - b.Property("SalaryClass") - .HasColumnType("longtext") - .HasComment("ตำแหน่ง (รายละเอียด)"); - - b.Property("SalaryRef") - .HasColumnType("longtext") - .HasComment("เอกสารอ้างอิง"); - - b.HasKey("Id"); - - b.HasIndex("ProfileSalaryId"); - - b.ToTable("ProfileSalaryHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateOrder") - .HasColumnType("datetime(6)") - .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); - - b.Property("Department") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); - - b.Property("Duration") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); - - b.Property("EndDate") - .HasColumnType("datetime(6)") - .HasComment("วันสิ้นสุดการฝึกอบรม/ดูงาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); - - b.Property("NumberOrder") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); - - b.Property("Place") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("สถานที่ฝึกอบรม/ดูงาน"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("StartDate") - .HasColumnType("datetime(6)") - .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); - - b.Property("Topic") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); - - b.Property("Yearly") - .HasMaxLength(200) - .HasColumnType("int") - .HasComment("ปีที่อบรม (พ.ศ.)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfileTraining"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateOrder") - .HasColumnType("datetime(6)") - .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); - - b.Property("Department") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); - - b.Property("Duration") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); - - b.Property("EndDate") - .HasColumnType("datetime(6)") - .HasComment("วันสิ้นสุดการฝึกอบรม/ดูงาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); - - b.Property("NumberOrder") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); - - b.Property("Place") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("สถานที่ฝึกอบรม/ดูงาน"); - - b.Property("ProfileTrainingId") - .HasColumnType("char(36)"); - - b.Property("StartDate") - .HasColumnType("datetime(6)") - .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); - - b.Property("Topic") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); - - b.Property("Yearly") - .HasMaxLength(200) - .HasColumnType("int") - .HasComment("ปีที่อบรม (พ.ศ.)"); - - b.HasKey("Id"); - - b.HasIndex("ProfileTrainingId"); - - b.ToTable("ProfileTrainingHistory"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .HasColumnType("longtext") - .HasComment("ประเภทการลา"); - - b.HasKey("Id"); - - b.ToTable("TypeLeave"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.BloodGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("varchar(2)") - .HasColumnOrder(1) - .HasComment("ชื่อหมู่โลหิต"); - - b.HasKey("Id"); - - b.ToTable("BloodGroups"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("varchar(150)") - .HasColumnOrder(1) - .HasComment("เขต/อำเภอ"); - - b.Property("ProvinceId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ProvinceId"); - - b.ToTable("Districts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.EducationLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ระดับการศึกษา"); - - b.HasKey("Id"); - - b.ToTable("EducationLevels"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Gender", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("varchar(20)") - .HasColumnOrder(1) - .HasComment("เพศ"); - - b.HasKey("Id"); - - b.ToTable("Genders"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Holiday", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Category") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(6) - .HasComment("ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("HolidayDate") - .HasColumnType("datetime(6)") - .HasColumnOrder(2) - .HasComment("วันหยุด"); - - b.Property("IsSpecial") - .HasColumnType("tinyint(1)") - .HasColumnOrder(5) - .HasComment("เป็นวันหยุดพิเศษหรือไม่"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("varchar(250)") - .HasColumnOrder(4) - .HasComment("ชื่อวันหยุด"); - - b.Property("OriginalDate") - .HasColumnType("datetime(6)") - .HasColumnOrder(3) - .HasComment("วันหยุด(Original)"); - - b.Property("Year") - .HasColumnType("int") - .HasColumnOrder(1) - .HasComment("ประจำปี"); - - b.HasKey("Id"); - - b.ToTable("Holidays"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("InsigniaTypeId") - .HasColumnType("char(36)"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(3) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Level") - .HasColumnType("int") - .HasColumnOrder(4) - .HasComment("ลำดับชั้นของเครื่องราช เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อเครื่องราช"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(5) - .HasComment("หมายเหตุ"); - - b.Property("ShortName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasColumnOrder(2) - .HasComment("ชื่อย่อเครื่องราช"); - - b.HasKey("Id"); - - b.HasIndex("InsigniaTypeId"); - - b.ToTable("Insignias"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.InsigniaType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)") - .HasColumnOrder(1) - .HasComment("ชื่อประเภทเครื่องราช"); - - b.HasKey("Id"); - - b.ToTable("InsigniaTypes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationAgency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงานต้นสังกัด"); - - b.HasKey("Id"); - - b.ToTable("OrganizationAgencys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationFax", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์โทรสาร"); - - b.HasKey("Id"); - - b.ToTable("OrganizationFaxs"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationGovernmentAgency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ ส่วนราชการต้นสังกัด"); - - b.HasKey("Id"); - - b.ToTable("OrganizationGovernmentAgencys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ ระดับ"); - - b.HasKey("Id"); - - b.ToTable("OrganizationLevels"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงาน"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.ToTable("OrganizationOrganizations"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AgencyCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสหน่วยงาน"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("GovernmentCode") - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(2) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(4) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(3) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(5) - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.ToTable("OrganizationShortNames"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ สถานะ"); - - b.HasKey("Id"); - - b.ToTable("OrganizationStatuses"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายนอก"); - - b.HasKey("Id"); - - b.ToTable("OrganizationTelExternals"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายใน"); - - b.HasKey("Id"); - - b.ToTable("OrganizationTelInternals"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ ประเภท"); - - b.HasKey("Id"); - - b.ToTable("OrganizationTypes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PhysicalStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("สถานภาพทางกาย"); - - b.HasKey("Id"); - - b.ToTable("PhysicalStatuses"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("ExecutiveName") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("varchar(300)") - .HasColumnOrder(3) - .HasComment("ชื่อตำแหน่งทางการบริหาร"); - - b.Property("ExecutiveSideId") - .HasColumnType("char(36)"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(9) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("varchar(300)") - .HasColumnOrder(1) - .HasComment("ชื่อตำแหน่ง"); - - b.Property("PathSideId") - .HasColumnType("char(36)"); - - b.Property("PositionCategory") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(8) - .HasComment("ตำแหน่งสำหรับข้าราชการหรือลูกจ้าง officer/employee"); - - b.Property("PositionLevelId") - .HasColumnType("char(36)"); - - b.Property("PositionPathId") - .HasColumnType("char(36)"); - - b.Property("PositionTypeId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("ExecutiveSideId"); - - b.HasIndex("PathSideId"); - - b.HasIndex("PositionLevelId"); - - b.HasIndex("PositionPathId"); - - b.HasIndex("PositionTypeId"); - - b.ToTable("Positions"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อกลุ่มงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); - - b.HasKey("Id"); - - b.ToTable("PositionEmployeeGroups"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(3) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(2) - .HasComment("ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); - - b.Property("Order") - .HasColumnType("int") - .HasColumnOrder(1) - .HasComment("ลำดับ"); - - b.HasKey("Id"); - - b.ToTable("PositionEmployeeLevels"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อสายงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); - - b.HasKey("Id"); - - b.ToTable("PositionEmployeeLines"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.ToTable("PositionEmployeePositions"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อด้านของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.ToTable("PositionEmployeePositionSides"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อสถานะของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); - - b.HasKey("Id"); - - b.ToTable("PositionEmployeeStatuses"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutive", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อตำแหน่งทางการบริหารของข้อมูลตำแหน่งของข้าราชการ"); - - b.HasKey("Id"); - - b.ToTable("PositionExecutives"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อด้านทางการบริหาร"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.ToTable("PositionExecutiveSides"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(5) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Level") - .HasColumnType("int") - .HasColumnOrder(4) - .HasComment("ลำดับชั้นของระดับตำแหน่ง"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(2) - .HasComment("ชื่อระดับตำแหน่ง"); - - b.Property("Order") - .HasColumnType("int") - .HasColumnOrder(1) - .HasComment("ลำดับ"); - - b.Property("ShortName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(3) - .HasComment("ชื่อย่อระดับตำแหน่ง"); - - b.HasKey("Id"); - - b.ToTable("PositionLevels"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อสายงานของข้อมูลตำแหน่งของข้าราชการ"); - - b.HasKey("Id"); - - b.ToTable("PositionLines"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อสายงาน"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.ToTable("PositionPaths"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPathSide", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อด้าน/สาขา"); - - b.Property("Note") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("หมายเหตุ"); - - b.HasKey("Id"); - - b.ToTable("PositionPathSides"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อสถานะของตำแหน่งของข้อมูลตำแหน่งของข้าราชการ"); - - b.HasKey("Id"); - - b.ToTable("PositionStatuss"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(3) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(2) - .HasComment("ชื่อประเภทตำแหน่ง"); - - b.Property("Order") - .HasColumnType("int") - .HasColumnOrder(1) - .HasComment("ลำดับ"); - - b.HasKey("Id"); - - b.ToTable("PositionTypes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Prefix", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(3) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)") - .HasColumnOrder(2) - .HasComment("รายละเอียดคำนำหน้า"); - - b.HasKey("Id"); - - b.ToTable("Prefixes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Province", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("varchar(150)") - .HasColumnOrder(1) - .HasComment("จังหวัด"); - - b.HasKey("Id"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Relationship", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)") - .HasColumnOrder(1) - .HasComment("ชื่อความสัมพันธ์"); - - b.HasKey("Id"); - - b.ToTable("Relationships"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Religion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ศาสนา"); - - b.HasKey("Id"); - - b.ToTable("Religions"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Royal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(3) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อประเภทข้อมูลเหรียญตรา"); - - b.Property("ShortName") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("varchar(10)") - .HasColumnOrder(2) - .HasComment("ชื่อย่อเหรียญตรา"); - - b.HasKey("Id"); - - b.ToTable("Royals"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalHierarchy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อลำดับชั้นข้อมูลเครื่องราชฯ"); - - b.HasKey("Id"); - - b.ToTable("RoyalHierarchys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(2) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)") - .HasColumnOrder(1) - .HasComment("ชื่อประเภทข้อมูลเครื่องราชฯ"); - - b.HasKey("Id"); - - b.ToTable("RoyalTypes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DistrictId") - .HasColumnType("char(36)"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(3) - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("varchar(150)") - .HasColumnOrder(1) - .HasComment("เขต/อำเภอ"); - - b.Property("ZipCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("varchar(10)") - .HasColumnOrder(2) - .HasComment("รหัสไปรษณีย์"); - - b.HasKey("Id"); - - b.HasIndex("DistrictId"); - - b.ToTable("SubDistricts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("PositionLevelId") - .HasColumnType("char(36)"); - - b.Property("PositionMasterId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("PositionLevelId"); - - b.HasIndex("PositionMasterId"); - - b.ToTable("AvailablePositionLevels"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Agency") - .HasColumnType("longtext") - .HasColumnOrder(14) - .HasComment("หน่วยงาน"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Department") - .HasColumnType("longtext") - .HasColumnOrder(16) - .HasComment("ฝ่าย/ส่วน"); - - b.Property("Government") - .HasColumnType("longtext") - .HasColumnOrder(15) - .HasComment("ส่วนราชการ"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasComment("สถานะการใช้งาน"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("OrganizationAgencyId") - .HasColumnType("char(36)") - .HasColumnOrder(10) - .HasComment("OrganizationAgencyId"); - - b.Property("OrganizationFaxId") - .HasColumnType("char(36)"); - - b.Property("OrganizationGovernmentAgencyId") - .HasColumnType("char(36)") - .HasColumnOrder(11) - .HasComment("OrganizationGovernmentAgencyId"); - - b.Property("OrganizationLevelId") - .HasColumnType("char(36)"); - - b.Property("OrganizationOrder") - .HasColumnType("int") - .HasColumnOrder(12) - .HasComment("OrganizationOrder"); - - b.Property("OrganizationOrganizationId") - .HasColumnType("char(36)"); - - b.Property("OrganizationShortNameId") - .HasColumnType("char(36)"); - - b.Property("OrganizationStatusId") - .HasColumnType("char(36)"); - - b.Property("OrganizationTelExternalId") - .HasColumnType("char(36)"); - - b.Property("OrganizationTelInternalId") - .HasColumnType("char(36)"); - - b.Property("OrganizationTypeId") - .HasColumnType("char(36)"); - - b.Property("OrganizationUserNote") - .HasColumnType("longtext") - .HasColumnOrder(13) - .HasComment("OrganizationUserNote"); - - b.Property("ParentId") - .HasColumnType("char(36)"); - - b.Property("Pile") - .HasColumnType("longtext") - .HasColumnOrder(17) - .HasComment("กอง"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationFaxId"); - - b.HasIndex("OrganizationLevelId"); - - b.HasIndex("OrganizationOrganizationId"); - - b.HasIndex("OrganizationShortNameId"); - - b.HasIndex("OrganizationStatusId"); - - b.HasIndex("OrganizationTelExternalId"); - - b.HasIndex("OrganizationTelInternalId"); - - b.HasIndex("OrganizationTypeId"); - - b.HasIndex("ParentId"); - - b.ToTable("Organizations"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsDirector") - .HasColumnType("tinyint(1)") - .HasColumnOrder(3) - .HasComment("Is Director"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("OrganizationId") - .HasColumnType("char(36)"); - - b.Property("PositionMasterId") - .HasColumnType("char(36)"); - - b.Property("PositionNumberId") - .HasColumnType("char(36)"); - - b.Property("PositionUserNote") - .HasColumnType("longtext") - .HasColumnOrder(4) - .HasComment("positionUserNote"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationId"); - - b.HasIndex("PositionMasterId"); - - b.HasIndex("PositionNumberId"); - - b.ToTable("OrganizationPositions"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsDirector") - .HasColumnType("tinyint(1)") - .HasColumnOrder(14) - .HasComment("IsDirector"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("PositionCondition") - .HasColumnType("longtext") - .HasColumnOrder(11) - .HasComment("PositionCondition"); - - b.Property("PositionExecutiveId") - .HasColumnType("char(36)"); - - b.Property("PositionExecutiveSideId") - .HasColumnType("char(36)"); - - b.Property("PositionExecutiveSideObject") - .HasColumnType("longtext"); - - b.Property("PositionId") - .HasColumnType("char(36)") - .HasColumnOrder(2) - .HasComment("PositionId"); - - b.Property("PositionLineId") - .HasColumnType("char(36)"); - - b.Property("PositionMasterUserNote") - .HasColumnType("longtext") - .HasColumnOrder(13) - .HasComment("PositionMasterUserNote"); - - b.Property("PositionPathId") - .HasColumnType("char(36)"); - - b.Property("PositionPathSideId") - .HasColumnType("char(36)"); - - b.Property("PositionPathSideObject") - .HasColumnType("longtext"); - - b.Property("PositionStatusId") - .HasColumnType("char(36)"); - - b.Property("PositionTypeId") - .HasColumnType("char(36)"); - - b.Property("Qualification") - .HasColumnType("longtext") - .HasColumnOrder(15) - .HasComment("คุณวุฒิ"); - - b.HasKey("Id"); - - b.HasIndex("PositionExecutiveId"); - - b.HasIndex("PositionExecutiveSideId"); - - b.HasIndex("PositionLineId"); - - b.HasIndex("PositionPathId"); - - b.HasIndex("PositionPathSideId"); - - b.HasIndex("PositionStatusId"); - - b.HasIndex("PositionTypeId"); - - b.ToTable("PositionMasters"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsDirector") - .HasColumnType("tinyint(1)") - .HasColumnOrder(14) - .HasComment("IsDirector"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Position") - .HasColumnType("longtext") - .HasColumnOrder(2) - .HasComment("Position"); - - b.Property("PositionCondition") - .HasColumnType("longtext") - .HasColumnOrder(11) - .HasComment("PositionCondition"); - - b.Property("PositionExecutive") - .HasColumnType("longtext") - .HasColumnOrder(5) - .HasComment("PositionExecutive"); - - b.Property("PositionExecutiveSide") - .HasColumnType("longtext") - .HasColumnOrder(6) - .HasComment("PositionExecutiveSide"); - - b.Property("PositionExecutiveSideObject") - .HasColumnType("longtext"); - - b.Property("PositionLevel") - .HasColumnType("longtext") - .HasColumnOrder(12) - .HasComment("PositionLevel"); - - b.Property("PositionLine") - .HasColumnType("longtext") - .HasColumnOrder(8) - .HasComment("PositionLine"); - - b.Property("PositionMasterEntityId") - .HasColumnType("char(36)"); - - b.Property("PositionMasterUserNote") - .HasColumnType("longtext") - .HasColumnOrder(13) - .HasComment("PositionMasterUserNote"); - - b.Property("PositionPath") - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("PositionPath"); - - b.Property("PositionPathSide") - .HasColumnType("longtext") - .HasColumnOrder(7) - .HasComment("PositionPathSide"); - - b.Property("PositionPathSideObject") - .HasColumnType("longtext"); - - b.Property("PositionStatus") - .HasColumnType("longtext") - .HasColumnOrder(10) - .HasComment("PositionStatus"); - - b.Property("PositionType") - .HasColumnType("longtext") - .HasColumnOrder(4) - .HasComment("PositionType"); - - b.Property("Qualification") - .HasColumnType("longtext") - .HasColumnOrder(15) - .HasComment("คุณวุฒิ"); - - b.HasKey("Id"); - - b.HasIndex("PositionMasterEntityId"); - - b.ToTable("PositionMasterHistoryEntity"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Name") - .HasMaxLength(300) - .HasColumnType("varchar(300)") - .HasColumnOrder(2) - .HasComment("ชื่อ"); - - b.Property("OrganizationShortNameId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationShortNameId"); - - b.ToTable("PositionNumbers"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsPublished") - .HasColumnType("tinyint(1)"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("OrganizationPositionId") - .HasColumnType("char(36)"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("OrganizationPositionId"); - - b.HasIndex("ProfileId"); - - b.ToTable("ProfilePositions"); - }); - modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => { b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal") @@ -10807,779 +2892,6 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigate"); }); - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") - .WithMany("LimitTypeLeaves") - .HasForeignKey("LimitLeaveId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") - .WithMany("LimitTypeLeaves") - .HasForeignKey("TypeLeaveId"); - - b.Navigation("LimitLeave"); - - b.Navigation("TypeLeave"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => - { - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Avatar") - .WithMany() - .HasForeignKey("AvatarId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.Gender", "Gender") - .WithMany() - .HasForeignKey("GenderId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") - .WithMany("Profiles") - .HasForeignKey("LimitLeaveId"); - - b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PosNo") - .WithMany() - .HasForeignKey("PosNoId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", "PositionEmployeeGroup") - .WithMany() - .HasForeignKey("PositionEmployeeGroupId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", "PositionEmployeeLevel") - .WithMany() - .HasForeignKey("PositionEmployeeLevelId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", "PositionEmployeeLine") - .WithMany() - .HasForeignKey("PositionEmployeeLineId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", "PositionEmployeePosition") - .WithMany() - .HasForeignKey("PositionEmployeePositionId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", "PositionEmployeePositionSide") - .WithMany() - .HasForeignKey("PositionEmployeePositionSideId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "Position") - .WithMany() - .HasForeignKey("PositionId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") - .WithMany() - .HasForeignKey("PositionLevelId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") - .WithMany() - .HasForeignKey("PositionTypeId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.Prefix", "Prefix") - .WithMany() - .HasForeignKey("PrefixId"); - - b.Navigation("Avatar"); - - b.Navigation("Gender"); - - b.Navigation("LimitLeave"); - - b.Navigation("PosNo"); - - b.Navigation("Position"); - - b.Navigation("PositionEmployeeGroup"); - - b.Navigation("PositionEmployeeLevel"); - - b.Navigation("PositionEmployeeLine"); - - b.Navigation("PositionEmployeePosition"); - - b.Navigation("PositionEmployeePositionSide"); - - b.Navigation("PositionLevel"); - - b.Navigation("PositionType"); - - b.Navigation("Prefix"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Abilitys") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAbility", "ProfileAbility") - .WithMany("ProfileAbilityHistorys") - .HasForeignKey("ProfileAbilityId"); - - b.Navigation("ProfileAbility"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("AddressHistory") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Assessments") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAssessment", "ProfileAssessment") - .WithMany("ProfileAssessmentHistorys") - .HasForeignKey("ProfileAssessmentId"); - - b.Navigation("ProfileAssessment"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "AvatarFile") - .WithMany() - .HasForeignKey("AvatarFileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("AvatarHistory") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("AvatarFile"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Certificates") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileCertificate", "ProfileCertificate") - .WithMany("ProfileCertificateHistorys") - .HasForeignKey("ProfileCertificateId"); - - b.Navigation("ProfileCertificate"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => - { - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") - .WithMany() - .HasForeignKey("DocumentId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("ChangeNames") - .HasForeignKey("ProfileId"); - - b.Navigation("Document"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") - .WithMany() - .HasForeignKey("DocumentId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChangeName", "ProfileChangeName") - .WithMany("ProfileChangeNameHistorys") - .HasForeignKey("ProfileChangeNameId"); - - b.Navigation("Document"); - - b.Navigation("ProfileChangeName"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Childrens") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChildren", null) - .WithMany("ProfileChildrenHistorys") - .HasForeignKey("ProfileChildrenId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", null) - .WithMany("Childrens") - .HasForeignKey("ProfileFamilyHistoryId"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("CoupleHistory") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("CurrentAddressHistory") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Disciplines") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDiscipline", "ProfileDiscipline") - .WithMany("ProfileDisciplineHistorys") - .HasForeignKey("ProfileDisciplineId"); - - b.Navigation("ProfileDiscipline"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Dutys") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDuty", "ProfileDuty") - .WithMany("ProfileDutyHistorys") - .HasForeignKey("ProfileDutyId"); - - b.Navigation("ProfileDuty"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Educations") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileEducation", "ProfileEducation") - .WithMany("ProfileEducationHistorys") - .HasForeignKey("ProfileEducationId"); - - b.Navigation("ProfileEducation"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Employments") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("FamilyHistory") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("FatherHistory") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("GovernmentHistory") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("ProfileHistory") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Honors") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileHonor", "ProfileHonor") - .WithMany("ProfileHonorHistorys") - .HasForeignKey("ProfileHonorId"); - - b.Navigation("ProfileHonor"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.Insignia", "Insignia") - .WithMany() - .HasForeignKey("InsigniaId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Insignias") - .HasForeignKey("ProfileId"); - - b.Navigation("Insignia"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileInsignia", "ProfileInsignia") - .WithMany("ProfileInsigniaHistorys") - .HasForeignKey("ProfileInsigniaId"); - - b.Navigation("ProfileInsignia"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Leaves") - .HasForeignKey("ProfileId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") - .WithMany() - .HasForeignKey("TypeLeaveId"); - - b.Navigation("Profile"); - - b.Navigation("TypeLeave"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileLeave", "ProfileLeave") - .WithMany("ProfileLeaveHistorys") - .HasForeignKey("ProfileLeaveId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") - .WithMany() - .HasForeignKey("TypeLeaveId"); - - b.Navigation("ProfileLeave"); - - b.Navigation("TypeLeave"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("MotherHistory") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Nopaids") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileNopaid", "ProfileNopaid") - .WithMany("ProfileNopaidHistorys") - .HasForeignKey("ProfileNopaidId"); - - b.Navigation("ProfileNopaid"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Others") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileOther", "ProfileOther") - .WithMany("ProfileOtherHistorys") - .HasForeignKey("ProfileOtherId"); - - b.Navigation("ProfileOther"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => - { - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") - .WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Papers") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Document"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("RegistrationAddressHistory") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") - .WithMany() - .HasForeignKey("PositionLevelId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Salaries") - .HasForeignKey("ProfileId"); - - b.Navigation("PositionLevel"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileSalary", "ProfileSalary") - .WithMany("ProfileSalaryHistorys") - .HasForeignKey("ProfileSalaryId"); - - b.Navigation("ProfileSalary"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany("Trainings") - .HasForeignKey("ProfileId"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", b => - { - b.HasOne("BMA.EHR.Domain.Models.HR.ProfileTraining", "ProfileTraining") - .WithMany("ProfileTrainingHistorys") - .HasForeignKey("ProfileTrainingId"); - - b.Navigation("ProfileTraining"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.Province", "Province") - .WithMany("Districts") - .HasForeignKey("ProvinceId"); - - b.Navigation("Province"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.InsigniaType", "InsigniaType") - .WithMany() - .HasForeignKey("InsigniaTypeId"); - - b.Navigation("InsigniaType"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "ExecutiveSide") - .WithMany() - .HasForeignKey("ExecutiveSideId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PathSide") - .WithMany() - .HasForeignKey("PathSideId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") - .WithMany() - .HasForeignKey("PositionLevelId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") - .WithMany() - .HasForeignKey("PositionPathId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") - .WithMany() - .HasForeignKey("PositionTypeId"); - - b.Navigation("ExecutiveSide"); - - b.Navigation("PathSide"); - - b.Navigation("PositionLevel"); - - b.Navigation("PositionPath"); - - b.Navigation("PositionType"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.District", "District") - .WithMany("SubDistricts") - .HasForeignKey("DistrictId"); - - b.Navigation("District"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") - .WithMany() - .HasForeignKey("PositionLevelId"); - - b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") - .WithMany() - .HasForeignKey("PositionMasterId"); - - b.Navigation("PositionLevel"); - - b.Navigation("PositionMaster"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationFax", "OrganizationFax") - .WithMany() - .HasForeignKey("OrganizationFaxId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", "OrganizationLevel") - .WithMany() - .HasForeignKey("OrganizationLevelId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "OrganizationOrganization") - .WithMany() - .HasForeignKey("OrganizationOrganizationId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") - .WithMany() - .HasForeignKey("OrganizationShortNameId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", "OrganizationStatus") - .WithMany() - .HasForeignKey("OrganizationStatusId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", "OrganizationTelExternal") - .WithMany() - .HasForeignKey("OrganizationTelExternalId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", "OrganizationTelInternal") - .WithMany() - .HasForeignKey("OrganizationTelInternalId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationType", "OrganizationType") - .WithMany() - .HasForeignKey("OrganizationTypeId"); - - b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Parent") - .WithMany("Organizations") - .HasForeignKey("ParentId"); - - b.Navigation("OrganizationFax"); - - b.Navigation("OrganizationLevel"); - - b.Navigation("OrganizationOrganization"); - - b.Navigation("OrganizationShortName"); - - b.Navigation("OrganizationStatus"); - - b.Navigation("OrganizationTelExternal"); - - b.Navigation("OrganizationTelInternal"); - - b.Navigation("OrganizationType"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", b => - { - b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Organization") - .WithMany() - .HasForeignKey("OrganizationId"); - - b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") - .WithMany() - .HasForeignKey("PositionMasterId"); - - b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PositionNumber") - .WithMany() - .HasForeignKey("PositionNumberId"); - - b.Navigation("Organization"); - - b.Navigation("PositionMaster"); - - b.Navigation("PositionNumber"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutive", "PositionExecutive") - .WithMany() - .HasForeignKey("PositionExecutiveId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "PositionExecutiveSide") - .WithMany() - .HasForeignKey("PositionExecutiveSideId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLine", "PositionLine") - .WithMany() - .HasForeignKey("PositionLineId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") - .WithMany() - .HasForeignKey("PositionPathId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PositionPathSide") - .WithMany() - .HasForeignKey("PositionPathSideId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionStatus", "PositionStatus") - .WithMany() - .HasForeignKey("PositionStatusId"); - - b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") - .WithMany() - .HasForeignKey("PositionTypeId"); - - b.Navigation("PositionExecutive"); - - b.Navigation("PositionExecutiveSide"); - - b.Navigation("PositionLine"); - - b.Navigation("PositionPath"); - - b.Navigation("PositionPathSide"); - - b.Navigation("PositionStatus"); - - b.Navigation("PositionType"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", b => - { - b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMasterEntity") - .WithMany("PositionMasterHistorys") - .HasForeignKey("PositionMasterEntityId"); - - b.Navigation("PositionMasterEntity"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => - { - b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") - .WithMany() - .HasForeignKey("OrganizationShortNameId"); - - b.Navigation("OrganizationShortName"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", b => - { - b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", "OrganizationPosition") - .WithMany() - .HasForeignKey("OrganizationPositionId"); - - b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") - .WithMany() - .HasForeignKey("ProfileId"); - - b.Navigation("OrganizationPosition"); - - b.Navigation("Profile"); - }); - modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => { b.Navigation("DisciplineComplaint_Docs"); @@ -11651,175 +2963,6 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.Navigation("DisciplineInvestigate_ProfileComplaints"); }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => - { - b.Navigation("LimitTypeLeaves"); - - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => - { - b.Navigation("Abilitys"); - - b.Navigation("AddressHistory"); - - b.Navigation("Assessments"); - - b.Navigation("AvatarHistory"); - - b.Navigation("Certificates"); - - b.Navigation("ChangeNames"); - - b.Navigation("Childrens"); - - b.Navigation("CoupleHistory"); - - b.Navigation("CurrentAddressHistory"); - - b.Navigation("Disciplines"); - - b.Navigation("Dutys"); - - b.Navigation("Educations"); - - b.Navigation("Employments"); - - b.Navigation("FamilyHistory"); - - b.Navigation("FatherHistory"); - - b.Navigation("GovernmentHistory"); - - b.Navigation("Honors"); - - b.Navigation("Insignias"); - - b.Navigation("Leaves"); - - b.Navigation("MotherHistory"); - - b.Navigation("Nopaids"); - - b.Navigation("Others"); - - b.Navigation("Papers"); - - b.Navigation("ProfileHistory"); - - b.Navigation("RegistrationAddressHistory"); - - b.Navigation("Salaries"); - - b.Navigation("Trainings"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => - { - b.Navigation("ProfileAbilityHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => - { - b.Navigation("ProfileAssessmentHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => - { - b.Navigation("ProfileCertificateHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => - { - b.Navigation("ProfileChangeNameHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => - { - b.Navigation("ProfileChildrenHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => - { - b.Navigation("ProfileDisciplineHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => - { - b.Navigation("ProfileDutyHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => - { - b.Navigation("ProfileEducationHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => - { - b.Navigation("Childrens"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => - { - b.Navigation("ProfileHonorHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => - { - b.Navigation("ProfileInsigniaHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => - { - b.Navigation("ProfileLeaveHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => - { - b.Navigation("ProfileNopaidHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => - { - b.Navigation("ProfileOtherHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => - { - b.Navigation("ProfileSalaryHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => - { - b.Navigation("ProfileTrainingHistorys"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => - { - b.Navigation("LimitTypeLeaves"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => - { - b.Navigation("SubDistricts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Province", b => - { - b.Navigation("Districts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => - { - b.Navigation("Organizations"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => - { - b.Navigation("PositionMasterHistorys"); - }); #pragma warning restore 612, 618 } } diff --git a/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs b/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs index 54777331..23154115 100644 --- a/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs +++ b/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs @@ -50,107 +50,107 @@ namespace BMA.EHR.Infrastructure.Persistence #endregion - #region " Meta Data " + // #region " Meta Data " - public DbSet Prefixes { get; set; } + // public DbSet Prefixes { get; set; } - public DbSet BloodGroups { get; set; } + // public DbSet BloodGroups { get; set; } - public DbSet Genders { get; set; } + // public DbSet Genders { get; set; } - public DbSet PhysicalStatuses { get; set; } + // public DbSet PhysicalStatuses { get; set; } - public DbSet Religions { get; set; } + // public DbSet Religions { get; set; } - public DbSet EducationLevels { get; set; } + // public DbSet EducationLevels { get; set; } - public DbSet PositionPaths { get; set; } + // public DbSet PositionPaths { get; set; } - public DbSet PositionTypes { get; set; } + // public DbSet PositionTypes { get; set; } - public DbSet PositionEmployeePositions { get; set; } + // public DbSet PositionEmployeePositions { get; set; } - public DbSet PositionEmployeePositionSides { get; set; } + // public DbSet PositionEmployeePositionSides { get; set; } - public DbSet PositionEmployeeGroups { get; set; } + // public DbSet PositionEmployeeGroups { get; set; } - public DbSet PositionEmployeeLines { get; set; } + // public DbSet PositionEmployeeLines { get; set; } - public DbSet PositionEmployeeLevels { get; set; } + // public DbSet PositionEmployeeLevels { get; set; } - public DbSet PositionEmployeeStatuses { get; set; } + // public DbSet PositionEmployeeStatuses { get; set; } - public DbSet PositionLines { get; set; } + // public DbSet PositionLines { get; set; } - public DbSet PositionExecutives { get; set; } + // public DbSet PositionExecutives { get; set; } - public DbSet PositionStatuss { get; set; } + // public DbSet PositionStatuss { get; set; } - public DbSet PositionLevels { get; set; } + // public DbSet PositionLevels { get; set; } - public DbSet Relationships { get; set; } + // public DbSet Relationships { get; set; } - public DbSet Positions { get; set; } + // public DbSet Positions { get; set; } - public DbSet PositionPathSides { get; set; } + // public DbSet PositionPathSides { get; set; } - public DbSet PositionExecutiveSides { get; set; } + // public DbSet PositionExecutiveSides { get; set; } - public DbSet InsigniaTypes { get; set; } + // public DbSet InsigniaTypes { get; set; } - public DbSet Insignias { get; set; } + // public DbSet Insignias { get; set; } - public DbSet Provinces { get; set; } + // public DbSet Provinces { get; set; } - public DbSet Districts { get; set; } + // public DbSet Districts { get; set; } - public DbSet SubDistricts { get; set; } + // public DbSet SubDistricts { get; set; } - public DbSet Holidays { get; set; } + // public DbSet Holidays { get; set; } - public DbSet OrganizationTypes { get; set; } + // public DbSet OrganizationTypes { get; set; } - public DbSet OrganizationLevels { get; set; } + // public DbSet OrganizationLevels { get; set; } - public DbSet OrganizationOrganizations { get; set; } + // public DbSet OrganizationOrganizations { get; set; } - public DbSet OrganizationShortNames { get; set; } + // public DbSet OrganizationShortNames { get; set; } - public DbSet OrganizationStatuses { get; set; } + // public DbSet OrganizationStatuses { get; set; } - public DbSet OrganizationAgencys { get; set; } + // public DbSet OrganizationAgencys { get; set; } - public DbSet OrganizationGovernmentAgencys { get; set; } + // public DbSet OrganizationGovernmentAgencys { get; set; } - public DbSet OrganizationTelExternals { get; set; } + // public DbSet OrganizationTelExternals { get; set; } - public DbSet OrganizationTelInternals { get; set; } + // public DbSet OrganizationTelInternals { get; set; } - public DbSet OrganizationFaxs { get; set; } + // public DbSet OrganizationFaxs { get; set; } - public DbSet RoyalHierarchys { get; set; } + // public DbSet RoyalHierarchys { get; set; } - public DbSet RoyalTypes { get; set; } + // public DbSet RoyalTypes { get; set; } - public DbSet Royals { get; set; } + // public DbSet Royals { get; set; } - #endregion + // #endregion - #region " Organizations " + // #region " Organizations " - public DbSet AvailablePositionLevels { get; set; } + // public DbSet AvailablePositionLevels { get; set; } - public DbSet PositionMasters { get; set; } + // public DbSet PositionMasters { get; set; } - public DbSet Organizations { get; set; } + // public DbSet Organizations { get; set; } - public DbSet PositionNumbers { get; set; } + // public DbSet PositionNumbers { get; set; } - public DbSet OrganizationPositions { get; set; } + // public DbSet OrganizationPositions { get; set; } - public DbSet ProfilePositions { get; set; } + // public DbSet ProfilePositions { get; set; } - #endregion + // #endregion public DisciplineDbContext(DbContextOptions options) : base(options) {