using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace APT.Data.Migrations.Migrations
{
    public partial class wyw2026052201 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "DT_APPROVE",
                table: "T_SE_TRAIN_RECORD",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "USER_ID_APPROVE",
                table: "T_SE_TRAIN_RECORD",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_T_SE_TRAIN_RECORD_USER_ID_APPROVE",
                table: "T_SE_TRAIN_RECORD",
                column: "USER_ID_APPROVE");

            migrationBuilder.AddForeignKey(
                name: "FK_T_SE_TRAIN_RECORD_T_FM_USER_USER_ID_APPROVE",
                table: "T_SE_TRAIN_RECORD",
                column: "USER_ID_APPROVE",
                principalTable: "T_FM_USER",
                principalColumn: "ID",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_T_SE_TRAIN_RECORD_T_FM_USER_USER_ID_APPROVE",
                table: "T_SE_TRAIN_RECORD");

            migrationBuilder.DropIndex(
                name: "IX_T_SE_TRAIN_RECORD_USER_ID_APPROVE",
                table: "T_SE_TRAIN_RECORD");

            migrationBuilder.DropColumn(
                name: "DT_APPROVE",
                table: "T_SE_TRAIN_RECORD");

            migrationBuilder.DropColumn(
                name: "USER_ID_APPROVE",
                table: "T_SE_TRAIN_RECORD");
        }
    }
}
