Change API Put and Post CommandType 01-09

This commit is contained in:
Suphonchai Phoonsawat 2023-08-25 10:32:43 +07:00
parent 0aa0aedba9
commit eba4e23bea
13 changed files with 17000 additions and 37 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,313 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddfieldForCommandType0509 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Commands_Placements_PlacementId",
table: "Commands");
migrationBuilder.AlterColumn<int>(
name: "TimeThink",
table: "RetirementQuestions",
type: "int",
nullable: true,
comment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "PositionName",
table: "Commands",
type: "longtext",
nullable: true,
comment: "ตำแหน่งที่บรรจุ",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ตำแหน่งที่บรรจุ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<Guid>(
name: "PlacementId",
table: "Commands",
type: "char(36)",
nullable: true,
comment: "อ้างอิงรอบการสอบ",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldComment: "อ้างอิงรอบการสอบ")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<string>(
name: "ConclusionResultNo",
table: "Commands",
type: "longtext",
nullable: true,
comment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionResultDate",
table: "Commands",
type: "datetime(6)",
nullable: true,
comment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldComment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)");
migrationBuilder.AlterColumn<string>(
name: "ConclusionRegisterNo",
table: "Commands",
type: "longtext",
nullable: true,
comment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionRegisterDate",
table: "Commands",
type: "datetime(6)",
nullable: true,
comment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldComment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)");
migrationBuilder.AddColumn<DateTime>(
name: "ConclusionMeetingDate",
table: "Commands",
type: "datetime(6)",
nullable: true,
comment: "การประชุม ลงวันที่");
migrationBuilder.AddColumn<string>(
name: "ConclusionMeetingNo",
table: "Commands",
type: "longtext",
nullable: true,
comment: "การประชุม ครั้งที่")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "ConclusionReturnDate",
table: "Commands",
type: "datetime(6)",
nullable: true,
comment: "ลงวันที่ (เรื่อง กลับเข้ารับราชการ)");
migrationBuilder.AddColumn<string>(
name: "ConclusionReturnNo",
table: "Commands",
type: "longtext",
nullable: true,
comment: "มติ กก. ครั้งที่ (เรื่อง กลับเข้ารับราชการ)")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "MilitaryCommanDate",
table: "Commands",
type: "datetime(6)",
nullable: true,
comment: "ลงวันที่ (ให้เข้ารับราชการทหาร)");
migrationBuilder.AddColumn<string>(
name: "MilitaryCommandNo",
table: "Commands",
type: "longtext",
nullable: true,
comment: "คำสั่งที่ (ให้เข้ารับราชการทหาร)")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "SourceOrganizationName",
table: "Commands",
type: "longtext",
nullable: true,
comment: "หน่วยงานต้นสังกัด ก่อนรับราชการทหาร")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddForeignKey(
name: "FK_Commands_Placements_PlacementId",
table: "Commands",
column: "PlacementId",
principalTable: "Placements",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Commands_Placements_PlacementId",
table: "Commands");
migrationBuilder.DropColumn(
name: "ConclusionMeetingDate",
table: "Commands");
migrationBuilder.DropColumn(
name: "ConclusionMeetingNo",
table: "Commands");
migrationBuilder.DropColumn(
name: "ConclusionReturnDate",
table: "Commands");
migrationBuilder.DropColumn(
name: "ConclusionReturnNo",
table: "Commands");
migrationBuilder.DropColumn(
name: "MilitaryCommanDate",
table: "Commands");
migrationBuilder.DropColumn(
name: "MilitaryCommandNo",
table: "Commands");
migrationBuilder.DropColumn(
name: "SourceOrganizationName",
table: "Commands");
migrationBuilder.AlterColumn<string>(
name: "TimeThink",
table: "RetirementQuestions",
type: "longtext",
nullable: true,
comment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Commands",
keyColumn: "PositionName",
keyValue: null,
column: "PositionName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "PositionName",
table: "Commands",
type: "longtext",
nullable: false,
comment: "ตำแหน่งที่บรรจุ",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ตำแหน่งที่บรรจุ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<Guid>(
name: "PlacementId",
table: "Commands",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
comment: "อ้างอิงรอบการสอบ",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "อ้างอิงรอบการสอบ")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Commands",
keyColumn: "ConclusionResultNo",
keyValue: null,
column: "ConclusionResultNo",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ConclusionResultNo",
table: "Commands",
type: "longtext",
nullable: false,
comment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionResultDate",
table: "Commands",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
comment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)");
migrationBuilder.UpdateData(
table: "Commands",
keyColumn: "ConclusionRegisterNo",
keyValue: null,
column: "ConclusionRegisterNo",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ConclusionRegisterNo",
table: "Commands",
type: "longtext",
nullable: false,
comment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionRegisterDate",
table: "Commands",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
comment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)");
migrationBuilder.AddForeignKey(
name: "FK_Commands_Placements_PlacementId",
table: "Commands",
column: "PlacementId",
principalTable: "Placements",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View file

@ -76,24 +76,38 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("varchar(4)")
.HasComment("ปีที่ออกคำสั่ง");
b.Property<DateTime>("ConclusionRegisterDate")
b.Property<DateTime?>("ConclusionMeetingDate")
.HasColumnType("datetime(6)")
.HasComment("การประชุม ลงวันที่");
b.Property<string>("ConclusionMeetingNo")
.HasColumnType("longtext")
.HasComment("การประชุม ครั้งที่");
b.Property<DateTime?>("ConclusionRegisterDate")
.HasColumnType("datetime(6)")
.HasComment("ลงวันที่ (เรื่อง รับสมัครสอบฯ)");
b.Property<string>("ConclusionRegisterNo")
.IsRequired()
.HasColumnType("longtext")
.HasComment("มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)");
b.Property<DateTime>("ConclusionResultDate")
b.Property<DateTime?>("ConclusionResultDate")
.HasColumnType("datetime(6)")
.HasComment("ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)");
b.Property<string>("ConclusionResultNo")
.IsRequired()
.HasColumnType("longtext")
.HasComment("มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)");
b.Property<DateTime?>("ConclusionReturnDate")
.HasColumnType("datetime(6)")
.HasComment("ลงวันที่ (เรื่อง กลับเข้ารับราชการ)");
b.Property<string>("ConclusionReturnNo")
.HasColumnType("longtext")
.HasComment("มติ กก. ครั้งที่ (เรื่อง กลับเข้ารับราชการ)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
@ -141,19 +155,30 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnOrder(102)
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
b.Property<DateTime?>("MilitaryCommanDate")
.HasColumnType("datetime(6)")
.HasComment("ลงวันที่ (ให้เข้ารับราชการทหาร)");
b.Property<string>("MilitaryCommandNo")
.HasColumnType("longtext")
.HasComment("คำสั่งที่ (ให้เข้ารับราชการทหาร)");
b.Property<Guid>("OwnerGovId")
.HasColumnType("char(36)")
.HasComment("รหัสส่วนราชการผู้ออกคำสั่ง");
b.Property<Guid>("PlacementId")
b.Property<Guid?>("PlacementId")
.HasColumnType("char(36)")
.HasComment("อ้างอิงรอบการสอบ");
b.Property<string>("PositionName")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ตำแหน่งที่บรรจุ");
b.Property<string>("SourceOrganizationName")
.HasColumnType("longtext")
.HasComment("หน่วยงานต้นสังกัด ก่อนรับราชการทหาร");
b.HasKey("Id");
b.HasIndex("CommandStatusId");
@ -13275,8 +13300,8 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("ความคิดเห็นและข้อเสนอแนะอื่น ๆ ");
b.Property<string>("TimeThink")
.HasColumnType("longtext")
b.Property<int?>("TimeThink")
.HasColumnType("int")
.HasComment("สำหรับการลาออกในครั้งนี้ ท่านได้คิดทบทวนอย่างจริงจังเป็นระยะเวลานานเท่าใด");
b.HasKey("Id");
@ -13473,9 +13498,7 @@ namespace BMA.EHR.Infrastructure.Migrations
b.HasOne("BMA.EHR.Domain.Models.Placement.Placement", "Placement")
.WithMany()
.HasForeignKey("PlacementId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PlacementId");
b.Navigation("CommandStatus");