using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PARR.DAL.Migrations
{
    /// <inheritdoc />
    public partial class tblsFieldFiltersRenameColumn : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_FieldFilters_JobDetails_JobDetailId",
                schema: "job",
                table: "FieldFilters");

            migrationBuilder.RenameColumn(
                name: "JobDetailId",
                schema: "job",
                table: "FieldFilters",
                newName: "JobDetailsId");

            migrationBuilder.RenameIndex(
                name: "IX_FieldFilters_JobDetailId",
                schema: "job",
                table: "FieldFilters",
                newName: "IX_FieldFilters_JobDetailsId");

            migrationBuilder.AddForeignKey(
                name: "FK_FieldFilters_JobDetails_JobDetailsId",
                schema: "job",
                table: "FieldFilters",
                column: "JobDetailsId",
                principalSchema: "job",
                principalTable: "JobDetails",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_FieldFilters_JobDetails_JobDetailsId",
                schema: "job",
                table: "FieldFilters");

            migrationBuilder.RenameColumn(
                name: "JobDetailsId",
                schema: "job",
                table: "FieldFilters",
                newName: "JobDetailId");

            migrationBuilder.RenameIndex(
                name: "IX_FieldFilters_JobDetailsId",
                schema: "job",
                table: "FieldFilters",
                newName: "IX_FieldFilters_JobDetailId");

            migrationBuilder.AddForeignKey(
                name: "FK_FieldFilters_JobDetails_JobDetailId",
                schema: "job",
                table: "FieldFilters",
                column: "JobDetailId",
                principalSchema: "job",
                principalTable: "JobDetails",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
