using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
    /// <inheritdoc />
    public partial class UpdateTablePositionExamAddPositionLevel1 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "DurationEnd",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "DurationStart",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationLevelId",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationLevelName",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "Major",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "Name",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "Scores",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "Name",
                table: "Careers");

            migrationBuilder.DropColumn(
                name: "Reason",
                table: "Careers");

            migrationBuilder.DropColumn(
                name: "Salary",
                table: "Careers");

            migrationBuilder.DropColumn(
                name: "OccupationCompany",
                table: "Candidates");

            migrationBuilder.DropColumn(
                name: "OccupationDepartment",
                table: "Candidates");

            migrationBuilder.DropColumn(
                name: "OccupationEmail",
                table: "Candidates");

            migrationBuilder.DropColumn(
                name: "OccupationType",
                table: "Candidates");

            migrationBuilder.AddColumn<DateTime>(
                name: "EducationEndDate",
                table: "Educations",
                type: "datetime(6)",
                nullable: true,
                comment: "วันที่สำเร็จการศึกษา");

            migrationBuilder.AddColumn<Guid>(
                name: "EducationLevelExamId",
                table: "Educations",
                type: "char(36)",
                nullable: true,
                comment: "Id วุฒิที่ใช้สมัครสอบ",
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "EducationLevelExamName",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "วุฒิที่ใช้สมัครสอบ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<Guid>(
                name: "EducationLevelHighId",
                table: "Educations",
                type: "char(36)",
                nullable: true,
                comment: "Id วุฒิการศึกษาสูงสุด",
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "EducationLevelHighName",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "วุฒิการศึกษาสูงสุด")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "EducationLocation",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "ชื่อสถานศึกษา")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "EducationMajor",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "สาขาวิชา/วิชาเอก")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "EducationName",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "ชื่อปริญญา")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "EducationScores",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "คะแนนเฉลี่ยสะสม")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "EducationType",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "ประเภทสถานศึกษา")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Position",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "ชื่อตำแหน่ง",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "ตำแหน่ง/ลักษณะงาน")
                .Annotation("MySql:CharSet", "utf8mb4")
                .Annotation("Relational:ColumnOrder", 3)
                .OldAnnotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:ColumnOrder", 4);

            migrationBuilder.AddColumn<string>(
                name: "Group",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "กลุ่ม/ฝ่าย")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Org",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "สังกัด")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Pile",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "กอง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "RangeDate",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "ระยะเวลา")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "OccupationTelephone",
                table: "Candidates",
                type: "varchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน",
                oldClrType: typeof(string),
                oldType: "varchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "โทรศัพท์ บริษัท")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "OccupationPosition",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "ตำแหน่งปัจจุบัน สังกัด",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "ตำแหน่งอาชีพ")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationGroup",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationOrg",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "ตำแหน่งปัจจุบัน ชื่อตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationPile",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "ตำแหน่งปัจจุบัน กอง")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationPositionType",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "ตำแหน่งปัจจุบัน ประเภทราชการ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "OccupationSalary",
                table: "Candidates",
                type: "int",
                nullable: true,
                comment: "ตำแหน่งปัจจุบัน เงินเดือน");
        }

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

            migrationBuilder.DropColumn(
                name: "EducationLevelExamId",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationLevelExamName",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationLevelHighId",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationLevelHighName",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationLocation",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationMajor",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationName",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationScores",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "EducationType",
                table: "Educations");

            migrationBuilder.DropColumn(
                name: "Group",
                table: "Careers");

            migrationBuilder.DropColumn(
                name: "Org",
                table: "Careers");

            migrationBuilder.DropColumn(
                name: "Pile",
                table: "Careers");

            migrationBuilder.DropColumn(
                name: "RangeDate",
                table: "Careers");

            migrationBuilder.DropColumn(
                name: "OccupationGroup",
                table: "Candidates");

            migrationBuilder.DropColumn(
                name: "OccupationOrg",
                table: "Candidates");

            migrationBuilder.DropColumn(
                name: "OccupationPile",
                table: "Candidates");

            migrationBuilder.DropColumn(
                name: "OccupationPositionType",
                table: "Candidates");

            migrationBuilder.DropColumn(
                name: "OccupationSalary",
                table: "Candidates");

            migrationBuilder.AddColumn<DateTime>(
                name: "DurationEnd",
                table: "Educations",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                comment: "ระยะเวลาสิ้นสุด")
                .Annotation("Relational:ColumnOrder", 2);

            migrationBuilder.AddColumn<DateTime>(
                name: "DurationStart",
                table: "Educations",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                comment: "ระยะเวลาเริ่ม")
                .Annotation("Relational:ColumnOrder", 1);

            migrationBuilder.AddColumn<Guid>(
                name: "EducationLevelId",
                table: "Educations",
                type: "char(36)",
                nullable: true,
                comment: "Idวุฒิที่ได้รับ",
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "EducationLevelName",
                table: "Educations",
                type: "longtext",
                nullable: true,
                comment: "วุฒิที่ได้รับ")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Major",
                table: "Educations",
                type: "longtext",
                nullable: false,
                comment: "สาขาวิชา/วิชาเอก")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Name",
                table: "Educations",
                type: "longtext",
                nullable: false,
                comment: "ชื่อสถานศึกษา")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<float>(
                name: "Scores",
                table: "Educations",
                type: "float",
                maxLength: 10,
                nullable: false,
                defaultValue: 0f,
                comment: "คะแนนเฉลี่ยตลอดหลักสูตร")
                .Annotation("Relational:ColumnOrder", 6);

            migrationBuilder.AlterColumn<string>(
                name: "Position",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "ตำแหน่ง/ลักษณะงาน",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "ชื่อตำแหน่ง")
                .Annotation("MySql:CharSet", "utf8mb4")
                .Annotation("Relational:ColumnOrder", 4)
                .OldAnnotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:ColumnOrder", 3);

            migrationBuilder.AddColumn<string>(
                name: "Name",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "สถานที่ทำงาน/ฝึกงาน")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Reason",
                table: "Careers",
                type: "longtext",
                nullable: false,
                comment: "เหตุผลที่ออก")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "Salary",
                table: "Careers",
                type: "int",
                maxLength: 20,
                nullable: false,
                defaultValue: 0,
                comment: "เงินเดือนสุดท้ายก่อนออก")
                .Annotation("Relational:ColumnOrder", 5);

            migrationBuilder.AlterColumn<string>(
                name: "OccupationTelephone",
                table: "Candidates",
                type: "varchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "โทรศัพท์ บริษัท",
                oldClrType: typeof(string),
                oldType: "varchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "OccupationPosition",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "ตำแหน่งอาชีพ",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "ตำแหน่งปัจจุบัน สังกัด")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationCompany",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "สำนัก/บริษัท บริษัท")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationDepartment",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "กอง/ฝ่าย บริษัท")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationEmail",
                table: "Candidates",
                type: "varchar(200)",
                maxLength: 200,
                nullable: true,
                comment: "อีเมล บริษัท")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OccupationType",
                table: "Candidates",
                type: "longtext",
                nullable: true,
                comment: "ประเภทอาชีพที่ทำงานมาก่อน")
                .Annotation("MySql:CharSet", "utf8mb4");
        }
    }
}
