using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
    /// <inheritdoc />
    public partial class updatetableDisciplineDirectorscommandnonullable : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "Duty",
                table: "DisciplineInvestigate_Directors",
                type: "longtext",
                nullable: true,
                comment: "หน้าที่",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "หน้าที่")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "CommandNo",
                table: "DisciplineInvestigate_Directors",
                type: "longtext",
                nullable: true,
                comment: "เลขที่คำสั่ง",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "เลขที่คำสั่ง")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Duty",
                table: "DisciplineDisciplinary_DirectorInvestigates",
                type: "longtext",
                nullable: true,
                comment: "หน้าที่",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "หน้าที่")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "CommandNo",
                table: "DisciplineDisciplinary_DirectorInvestigates",
                type: "longtext",
                nullable: true,
                comment: "เลขที่คำสั่ง",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "เลขที่คำสั่ง")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.UpdateData(
                table: "DisciplineInvestigate_Directors",
                keyColumn: "Duty",
                keyValue: null,
                column: "Duty",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Duty",
                table: "DisciplineInvestigate_Directors",
                type: "longtext",
                nullable: false,
                comment: "หน้าที่",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "หน้าที่")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "DisciplineInvestigate_Directors",
                keyColumn: "CommandNo",
                keyValue: null,
                column: "CommandNo",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "CommandNo",
                table: "DisciplineInvestigate_Directors",
                type: "longtext",
                nullable: false,
                comment: "เลขที่คำสั่ง",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "เลขที่คำสั่ง")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "DisciplineDisciplinary_DirectorInvestigates",
                keyColumn: "Duty",
                keyValue: null,
                column: "Duty",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Duty",
                table: "DisciplineDisciplinary_DirectorInvestigates",
                type: "longtext",
                nullable: false,
                comment: "หน้าที่",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "หน้าที่")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "DisciplineDisciplinary_DirectorInvestigates",
                keyColumn: "CommandNo",
                keyValue: null,
                column: "CommandNo",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "CommandNo",
                table: "DisciplineDisciplinary_DirectorInvestigates",
                type: "longtext",
                nullable: false,
                comment: "เลขที่คำสั่ง",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "เลขที่คำสั่ง")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }
    }
}
