using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
    /// <inheritdoc />
    public partial class updatetableDisciplineDisciplinarysaddDisciplineDisciplinary_ProfileComplaintInvestigates : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_DisciplineReport_Profiles_DisciplineDisciplinarys_Discipline~",
                table: "DisciplineReport_Profiles");

            migrationBuilder.RenameColumn(
                name: "DisciplineDisciplinaryId",
                table: "DisciplineReport_Profiles",
                newName: "DisciplineDisciplinary_ProfileComplaintInvestigateId");

            migrationBuilder.RenameIndex(
                name: "IX_DisciplineReport_Profiles_DisciplineDisciplinaryId",
                table: "DisciplineReport_Profiles",
                newName: "IX_DisciplineReport_Profiles_DisciplineDisciplinary_ProfileComp~");

            migrationBuilder.AddForeignKey(
                name: "FK_DisciplineReport_Profiles_DisciplineDisciplinary_ProfileComp~",
                table: "DisciplineReport_Profiles",
                column: "DisciplineDisciplinary_ProfileComplaintInvestigateId",
                principalTable: "DisciplineDisciplinary_ProfileComplaintInvestigates",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

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

            migrationBuilder.RenameColumn(
                name: "DisciplineDisciplinary_ProfileComplaintInvestigateId",
                table: "DisciplineReport_Profiles",
                newName: "DisciplineDisciplinaryId");

            migrationBuilder.RenameIndex(
                name: "IX_DisciplineReport_Profiles_DisciplineDisciplinary_ProfileComp~",
                table: "DisciplineReport_Profiles",
                newName: "IX_DisciplineReport_Profiles_DisciplineDisciplinaryId");

            migrationBuilder.AddForeignKey(
                name: "FK_DisciplineReport_Profiles_DisciplineDisciplinarys_Discipline~",
                table: "DisciplineReport_Profiles",
                column: "DisciplineDisciplinaryId",
                principalTable: "DisciplineDisciplinarys",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
