using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
    /// <inheritdoc />
    public partial class UpdatetableCandidateaddbank2 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "PositionExamId",
                table: "Candidates",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.CreateIndex(
                name: "IX_Candidates_PositionExamId",
                table: "Candidates",
                column: "PositionExamId");

            migrationBuilder.AddForeignKey(
                name: "FK_Candidates_PositionExams_PositionExamId",
                table: "Candidates",
                column: "PositionExamId",
                principalTable: "PositionExams",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Candidates_PositionExams_PositionExamId",
                table: "Candidates");

            migrationBuilder.DropIndex(
                name: "IX_Candidates_PositionExamId",
                table: "Candidates");

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