using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Monitoring.Infrastructure.Data.Migrations
{
    /// <inheritdoc />
    public partial class CallsRelinkToAlarmScope : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Calls_Alarms_AlarmId",
                table: "Calls");

            migrationBuilder.RenameColumn(
                name: "AlarmId",
                table: "Calls",
                newName: "AlarmScopeId");

            migrationBuilder.RenameIndex(
                name: "IX_Calls_AlarmId",
                table: "Calls",
                newName: "IX_Calls_AlarmScopeId");

            migrationBuilder.AddForeignKey(
                name: "FK_Calls_AlarmScopes_AlarmScopeId",
                table: "Calls",
                column: "AlarmScopeId",
                principalTable: "AlarmScopes",
                principalColumn: "Id");
        }

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

            migrationBuilder.RenameColumn(
                name: "AlarmScopeId",
                table: "Calls",
                newName: "AlarmId");

            migrationBuilder.RenameIndex(
                name: "IX_Calls_AlarmScopeId",
                table: "Calls",
                newName: "IX_Calls_AlarmId");

            migrationBuilder.AddForeignKey(
                name: "FK_Calls_Alarms_AlarmId",
                table: "Calls",
                column: "AlarmId",
                principalTable: "Alarms",
                principalColumn: "Id");
        }
    }
}
