using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
    /// <inheritdoc />
    public partial class add_fields_disable_and_disableScore : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<double>(
                name: "SumC",
                table: "DisableScores",
                type: "double",
                nullable: false,
                comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม",
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<double>(
                name: "SumB",
                table: "DisableScores",
                type: "double",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<double>(
                name: "SumAB",
                table: "DisableScores",
                type: "double",
                nullable: false,
                comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม",
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<double>(
                name: "SumA",
                table: "DisableScores",
                type: "double",
                nullable: false,
                comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม",
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<double>(
                name: "PercentageC",
                table: "DisableScores",
                type: "double",
                nullable: false,
                comment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ",
                oldClrType: typeof(double),
                oldType: "double");

            migrationBuilder.AlterColumn<double>(
                name: "PercentageB",
                table: "DisableScores",
                type: "double",
                nullable: true,
                oldClrType: typeof(double),
                oldType: "double");

            migrationBuilder.AlterColumn<double>(
                name: "PercentageA",
                table: "DisableScores",
                type: "double",
                nullable: false,
                comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ",
                oldClrType: typeof(double),
                oldType: "double");

            migrationBuilder.AlterColumn<int>(
                name: "FullC",
                table: "DisableScores",
                type: "int",
                nullable: false,
                comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม",
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<int>(
                name: "FullB",
                table: "DisableScores",
                type: "int",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<int>(
                name: "FullA",
                table: "DisableScores",
                type: "int",
                nullable: false,
                comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม",
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<string>(
                name: "ExamStatus",
                table: "DisableScores",
                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: "DisableScores",
                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: "DisableScores",
                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: "BStatus",
                table: "DisableScores",
                type: "varchar(50)",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "varchar(50)",
                oldMaxLength: 50)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "AStatus",
                table: "DisableScores",
                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: "DisableScores",
                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: "DisableScores",
                type: "varchar(13)",
                maxLength: 13,
                nullable: false,
                defaultValue: "",
                comment: "เลขประจำตัวประชาชน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "FullD",
                table: "DisableScores",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม");

            migrationBuilder.AddColumn<int>(
                name: "FullScore",
                table: "DisableScores",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "คะแนนเต็ม");

            migrationBuilder.AddColumn<string>(
                name: "RemarkExamOrder",
                table: "DisableScores",
                type: "longtext",
                nullable: false,
                comment: "หมายเหตุจากลำดับที่สอบได้")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "RemarkScore",
                table: "DisableScores",
                type: "longtext",
                nullable: false,
                comment: "หมายเหตุจากบัญชีรวมคะแนน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<double>(
                name: "SumCD",
                table: "DisableScores",
                type: "double",
                nullable: false,
                defaultValue: 0.0,
                comment: "ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์");

            migrationBuilder.AddColumn<double>(
                name: "SumD",
                table: "DisableScores",
                type: "double",
                nullable: false,
                defaultValue: 0.0,
                comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม");

            migrationBuilder.AddColumn<double>(
                name: "TotalScore",
                table: "DisableScores",
                type: "double",
                nullable: false,
                defaultValue: 0.0,
                comment: "คะแนนรวม");

            migrationBuilder.AddColumn<string>(
                name: "HddPosition",
                table: "Disables",
                type: "longtext",
                nullable: true,
                comment: "บัญชีสอบ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "typeTest",
                table: "Disables",
                type: "longtext",
                nullable: true,
                comment: "ประเภทการสอบภาค ก.")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CitizenId",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "FullD",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "FullScore",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "RemarkExamOrder",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "RemarkScore",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "SumCD",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "SumD",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "TotalScore",
                table: "DisableScores");

            migrationBuilder.DropColumn(
                name: "HddPosition",
                table: "Disables");

            migrationBuilder.DropColumn(
                name: "typeTest",
                table: "Disables");

            migrationBuilder.AlterColumn<int>(
                name: "SumC",
                table: "DisableScores",
                type: "int",
                nullable: false,
                oldClrType: typeof(double),
                oldType: "double",
                oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม");

            migrationBuilder.AlterColumn<int>(
                name: "SumB",
                table: "DisableScores",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(double),
                oldType: "double",
                oldNullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "SumAB",
                table: "DisableScores",
                type: "int",
                nullable: false,
                oldClrType: typeof(double),
                oldType: "double",
                oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");

            migrationBuilder.AlterColumn<int>(
                name: "SumA",
                table: "DisableScores",
                type: "int",
                nullable: false,
                oldClrType: typeof(double),
                oldType: "double",
                oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");

            migrationBuilder.AlterColumn<double>(
                name: "PercentageC",
                table: "DisableScores",
                type: "double",
                nullable: false,
                oldClrType: typeof(double),
                oldType: "double",
                oldComment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ");

            migrationBuilder.AlterColumn<double>(
                name: "PercentageB",
                table: "DisableScores",
                type: "double",
                nullable: false,
                defaultValue: 0.0,
                oldClrType: typeof(double),
                oldType: "double",
                oldNullable: true);

            migrationBuilder.AlterColumn<double>(
                name: "PercentageA",
                table: "DisableScores",
                type: "double",
                nullable: false,
                oldClrType: typeof(double),
                oldType: "double",
                oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ");

            migrationBuilder.AlterColumn<int>(
                name: "FullC",
                table: "DisableScores",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม");

            migrationBuilder.AlterColumn<int>(
                name: "FullB",
                table: "DisableScores",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "FullA",
                table: "DisableScores",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม");

            migrationBuilder.AlterColumn<string>(
                name: "ExamStatus",
                table: "DisableScores",
                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: "DisableScores",
                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: "DisableScores",
                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.UpdateData(
                table: "DisableScores",
                keyColumn: "BStatus",
                keyValue: null,
                column: "BStatus",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "BStatus",
                table: "DisableScores",
                type: "varchar(50)",
                maxLength: 50,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "varchar(50)",
                oldMaxLength: 50,
                oldNullable: true)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "AStatus",
                table: "DisableScores",
                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: "DisableScores",
                type: "varchar(50)",
                maxLength: 50,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "varchar(50)",
                oldMaxLength: 50,
                oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }
    }
}
