using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
    /// <inheritdoc />
    public partial class updatetableperiodexamdatecannull : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<DateTime>(
                name: "RegisterStartDate",
                table: "PeriodExams",
                type: "datetime(6)",
                nullable: true,
                comment: "วันเริ่มสมัครสอบ",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldComment: "วันเริ่มสมัครสอบ");

            migrationBuilder.AlterColumn<DateTime>(
                name: "RegisterEndDate",
                table: "PeriodExams",
                type: "datetime(6)",
                nullable: true,
                comment: "วันสิ้นสุดสมัครสอบ",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldComment: "วันสิ้นสุดสมัครสอบ");

            migrationBuilder.AlterColumn<DateTime>(
                name: "PaymentStartDate",
                table: "PeriodExams",
                type: "datetime(6)",
                nullable: true,
                comment: "วันเริ่มชำระเงิน",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldComment: "วันเริ่มชำระเงิน");

            migrationBuilder.AlterColumn<DateTime>(
                name: "PaymentEndDate",
                table: "PeriodExams",
                type: "datetime(6)",
                nullable: true,
                comment: "วันสิ้นสุดชำระเงิน",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldComment: "วันสิ้นสุดชำระเงิน");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ExamDate",
                table: "PeriodExams",
                type: "datetime(6)",
                nullable: true,
                comment: "วันที่สอบ",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldComment: "วันที่สอบ");

            migrationBuilder.AlterColumn<DateTime>(
                name: "AnnouncementDate",
                table: "PeriodExams",
                type: "datetime(6)",
                nullable: true,
                comment: "วันประกาศผลสอบ",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldComment: "วันประกาศผลสอบ");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<DateTime>(
                name: "RegisterStartDate",
                table: "PeriodExams",
                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.AlterColumn<DateTime>(
                name: "RegisterEndDate",
                table: "PeriodExams",
                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.AlterColumn<DateTime>(
                name: "PaymentStartDate",
                table: "PeriodExams",
                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.AlterColumn<DateTime>(
                name: "PaymentEndDate",
                table: "PeriodExams",
                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.AlterColumn<DateTime>(
                name: "ExamDate",
                table: "PeriodExams",
                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.AlterColumn<DateTime>(
                name: "AnnouncementDate",
                table: "PeriodExams",
                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: "วันประกาศผลสอบ");
        }
    }
}
