migrate (add fields & comment task #1786, #1787, #1788)

This commit is contained in:
Bright 2025-09-02 15:11:24 +07:00
parent a352ec6578
commit f5f4115ef0
7 changed files with 3720 additions and 31 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Recruit.Service.Migrations
{
/// <inheritdoc />
public partial class add_field_recruitsHddPosition : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "HddPosition",
table: "Recruits",
type: "longtext",
nullable: true,
comment: "บัญชีสอบ")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "HddPosition",
table: "Recruits");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,426 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Recruit.Service.Migrations
{
/// <inheritdoc />
public partial class add_fields_RecruitScore : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<double>(
name: "SumC",
table: "RecruitScores",
type: "double",
nullable: false,
comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม",
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<double>(
name: "SumB",
table: "RecruitScores",
type: "double",
nullable: true,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<double>(
name: "SumAB",
table: "RecruitScores",
type: "double",
nullable: false,
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม",
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<double>(
name: "SumA",
table: "RecruitScores",
type: "double",
nullable: false,
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม",
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<double>(
name: "PercentageC",
table: "RecruitScores",
type: "double",
nullable: false,
comment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ",
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<double>(
name: "PercentageB",
table: "RecruitScores",
type: "double",
nullable: true,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<double>(
name: "PercentageA",
table: "RecruitScores",
type: "double",
nullable: false,
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ",
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<int>(
name: "FullC",
table: "RecruitScores",
type: "int",
nullable: false,
comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม",
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "FullB",
table: "RecruitScores",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "FullA",
table: "RecruitScores",
type: "int",
nullable: false,
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม",
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "ExamStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "สอบได้ / ตก / ขาดสอบ",
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ExamId",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "เลขประจำตัวสอบ",
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "CStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน",
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "AStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน",
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ABStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน",
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "CitizenId",
table: "RecruitScores",
type: "varchar(13)",
maxLength: 13,
nullable: false,
defaultValue: "",
comment: "เลขประจำตัวประชาชน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "FullD",
table: "RecruitScores",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม");
migrationBuilder.AddColumn<int>(
name: "FullScore",
table: "RecruitScores",
type: "int",
nullable: false,
defaultValue: 0,
comment: "คะแนนเต็ม");
migrationBuilder.AddColumn<string>(
name: "RemarkExamOrder",
table: "RecruitScores",
type: "longtext",
nullable: false,
comment: "หมายเหตุจากลำดับที่สอบได้")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "RemarkScore",
table: "RecruitScores",
type: "longtext",
nullable: false,
comment: "หมายเหตุจากบัญชีรวมคะแนน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<double>(
name: "SumCD",
table: "RecruitScores",
type: "double",
nullable: false,
defaultValue: 0.0,
comment: "ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์");
migrationBuilder.AddColumn<double>(
name: "SumD",
table: "RecruitScores",
type: "double",
nullable: false,
defaultValue: 0.0,
comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม");
migrationBuilder.AddColumn<double>(
name: "TotalScore",
table: "RecruitScores",
type: "double",
nullable: false,
defaultValue: 0.0,
comment: "คะแนนรวม");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CitizenId",
table: "RecruitScores");
migrationBuilder.DropColumn(
name: "FullD",
table: "RecruitScores");
migrationBuilder.DropColumn(
name: "FullScore",
table: "RecruitScores");
migrationBuilder.DropColumn(
name: "RemarkExamOrder",
table: "RecruitScores");
migrationBuilder.DropColumn(
name: "RemarkScore",
table: "RecruitScores");
migrationBuilder.DropColumn(
name: "SumCD",
table: "RecruitScores");
migrationBuilder.DropColumn(
name: "SumD",
table: "RecruitScores");
migrationBuilder.DropColumn(
name: "TotalScore",
table: "RecruitScores");
migrationBuilder.AlterColumn<double>(
name: "SumC",
table: "RecruitScores",
type: "double",
nullable: false,
oldClrType: typeof(double),
oldType: "double",
oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม");
migrationBuilder.AlterColumn<double>(
name: "SumB",
table: "RecruitScores",
type: "double",
nullable: false,
defaultValue: 0.0,
oldClrType: typeof(double),
oldType: "double",
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "SumAB",
table: "RecruitScores",
type: "double",
nullable: false,
oldClrType: typeof(double),
oldType: "double",
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
migrationBuilder.AlterColumn<double>(
name: "SumA",
table: "RecruitScores",
type: "double",
nullable: false,
oldClrType: typeof(double),
oldType: "double",
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
migrationBuilder.AlterColumn<double>(
name: "PercentageC",
table: "RecruitScores",
type: "double",
nullable: false,
oldClrType: typeof(double),
oldType: "double",
oldComment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ");
migrationBuilder.AlterColumn<double>(
name: "PercentageB",
table: "RecruitScores",
type: "double",
nullable: false,
defaultValue: 0.0,
oldClrType: typeof(double),
oldType: "double",
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "PercentageA",
table: "RecruitScores",
type: "double",
nullable: false,
oldClrType: typeof(double),
oldType: "double",
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ");
migrationBuilder.AlterColumn<int>(
name: "FullC",
table: "RecruitScores",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int",
oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม");
migrationBuilder.AlterColumn<int>(
name: "FullB",
table: "RecruitScores",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "FullA",
table: "RecruitScores",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int",
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม");
migrationBuilder.AlterColumn<string>(
name: "ExamStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "สอบได้ / ตก / ขาดสอบ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ExamId",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "เลขประจำตัวสอบ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "CStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "AStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ABStatus",
table: "RecruitScores",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -125,6 +125,10 @@ namespace BMA.EHR.Recruit.Service.Migrations
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("HddPosition")
.HasColumnType("longtext")
.HasComment("บัญชีสอบ");
b.Property<string>("Isspecial")
.IsRequired()
.HasMaxLength(1)
@ -1148,12 +1152,14 @@ namespace BMA.EHR.Recruit.Service.Migrations
b.Property<string>("ABStatus")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
.HasColumnType("varchar(50)")
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน");
b.Property<string>("AStatus")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
.HasColumnType("varchar(50)")
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน");
b.Property<string>("BStatus")
.IsRequired()
@ -1163,7 +1169,14 @@ namespace BMA.EHR.Recruit.Service.Migrations
b.Property<string>("CStatus")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
.HasColumnType("varchar(50)")
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน");
b.Property<string>("CitizenId")
.IsRequired()
.HasMaxLength(13)
.HasColumnType("varchar(13)")
.HasComment("เลขประจำตัวประชาชน");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
@ -1187,21 +1200,33 @@ namespace BMA.EHR.Recruit.Service.Migrations
b.Property<string>("ExamId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
.HasColumnType("varchar(50)")
.HasComment("เลขประจำตัวสอบ");
b.Property<string>("ExamStatus")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
.HasColumnType("varchar(50)")
.HasComment("สอบได้ / ตก / ขาดสอบ");
b.Property<int>("FullA")
.HasColumnType("int");
.HasColumnType("int")
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม");
b.Property<int>("FullB")
b.Property<int?>("FullB")
.HasColumnType("int");
b.Property<int>("FullC")
.HasColumnType("int");
.HasColumnType("int")
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม");
b.Property<int>("FullD")
.HasColumnType("int")
.HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม");
b.Property<int>("FullScore")
.HasColumnType("int")
.HasComment("คะแนนเต็ม");
b.Property<string>("LastUpdateFullName")
.IsRequired()
@ -1234,28 +1259,55 @@ namespace BMA.EHR.Recruit.Service.Migrations
.HasComment("ลำดับที่สอบได้");
b.Property<double>("PercentageA")
.HasColumnType("double");
.HasColumnType("double")
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ");
b.Property<double>("PercentageB")
b.Property<double?>("PercentageB")
.HasColumnType("double");
b.Property<double>("PercentageC")
.HasColumnType("double");
.HasColumnType("double")
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ");
b.Property<string>("RemarkExamOrder")
.IsRequired()
.HasColumnType("longtext")
.HasComment("หมายเหตุจากลำดับที่สอบได้");
b.Property<string>("RemarkScore")
.IsRequired()
.HasColumnType("longtext")
.HasComment("หมายเหตุจากบัญชีรวมคะแนน");
b.Property<Guid>("ScoreImportId")
.HasColumnType("char(36)");
b.Property<double>("SumA")
.HasColumnType("double");
.HasColumnType("double")
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
b.Property<double>("SumAB")
.HasColumnType("double");
.HasColumnType("double")
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
b.Property<double>("SumB")
b.Property<double?>("SumB")
.HasColumnType("double");
b.Property<double>("SumC")
.HasColumnType("double");
.HasColumnType("double")
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม");
b.Property<double>("SumCD")
.HasColumnType("double")
.HasComment("ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์");
b.Property<double>("SumD")
.HasColumnType("double")
.HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม");
b.Property<double>("TotalScore")
.HasColumnType("double")
.HasComment("คะแนนรวม");
b.HasKey("Id");

View file

@ -77,6 +77,8 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits
public DateTime ApplyDate { get; set; }
public string? PositionName { get; set; }
[Comment("บัญชีสอบ")]
public string? HddPosition { get; set; } = string.Empty;
public string? PositionType { get; set; }
public string? PositionLevel { get; set; }
public string? AuthName { get; set; }

View file

@ -5,42 +5,64 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits
{
public class RecruitScore : EntityBase
{
[Required, MaxLength(50)]
[Required, MaxLength(50), Comment("เลขประจำตัวสอบ")]
public string ExamId { get; set; }
public double SumA { get; set; }
[Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม")]
public double SumA { get; set; }
public int FullA { get; set; }
[Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม")]
public int FullA { get; set; }
public double PercentageA { get; set; }
[Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ")]
public double PercentageA { get; set; }
[MaxLength(50)]
[MaxLength(50), Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")]
public string AStatus { get; set; }
public double SumB { get; set; }
public double? SumB { get; set; }
public int FullB { get; set; }
public int? FullB { get; set; }
public double PercentageB { get; set; }
public double? PercentageB { get; set; }
[MaxLength(50)]
public string BStatus { get; set; }
public double SumAB { get; set; }
[Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม")]
public double SumAB { get; set; }
[Required, MaxLength(50)]
[Required, MaxLength(50), Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")]
public string ABStatus { get; set; }
public double SumC { get; set; }
[Comment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม")]
public double SumC { get; set; }
public int FullC { get; set; }
[Comment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม")]
public int FullC { get; set; }
public double PercentageC { get; set; }
[Comment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ")]
public double PercentageC { get; set; }
[MaxLength(50)]
[MaxLength(50), Comment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน")]
public string CStatus { get; set; }
[Required, MaxLength(50)]
[Comment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม")]
public double SumD { get; set; }
[Comment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม")]
public int FullD { get; set; }
[Comment("ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์")]
public double SumCD { get; set; }
[Comment("คะแนนรวม")]
public double TotalScore { get; set; }
[Comment("คะแนนเต็ม")]
public int FullScore { get; set; }
[Required, MaxLength(50), Comment("สอบได้ / ตก / ขาดสอบ")]
public string ExamStatus { get; set; }
[MaxLength(200)]
@ -49,6 +71,15 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits
[MaxLength(200),Comment("ลำดับที่สอบได้")]
public string Number { get; set; } = string.Empty;
public ScoreImport ScoreImport { get; set; }
[MaxLength(13), Comment("เลขประจำตัวประชาชน")]
public string CitizenId { get; set; } = string.Empty;
[Comment("หมายเหตุจากบัญชีรวมคะแนน")]
public string RemarkScore { get; set; } = string.Empty;
[Comment("หมายเหตุจากลำดับที่สอบได้")]
public string RemarkExamOrder { get; set; } = string.Empty;
public ScoreImport ScoreImport { get; set; }
}
}