using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PARR.DAL.Migrations
{
    /// <inheritdoc />
    public partial class addRel_JobGroup_UnitField : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateIndex(
                name: "IX_Groups_GroupingUnitFieldId",
                schema: "job",
                table: "Groups",
                column: "GroupingUnitFieldId");

            migrationBuilder.AddForeignKey(
                name: "FK_Groups_Fields_GroupingUnitFieldId",
                schema: "job",
                table: "Groups",
                column: "GroupingUnitFieldId",
                principalSchema: "unit",
                principalTable: "Fields",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

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

            migrationBuilder.DropIndex(
                name: "IX_Groups_GroupingUnitFieldId",
                schema: "job",
                table: "Groups");
        }
    }
}
