using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Brizco.Repository.Migrations
{
    /// <inheritdoc />
    public partial class editShiftPlanAddComplexId : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "ComplexId",
                schema: "public",
                table: "ShiftPlans",
                type: "uuid",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.CreateIndex(
                name: "IX_ShiftPlans_ComplexId",
                schema: "public",
                table: "ShiftPlans",
                column: "ComplexId");

            migrationBuilder.AddForeignKey(
                name: "FK_ShiftPlans_Complexes_ComplexId",
                schema: "public",
                table: "ShiftPlans",
                column: "ComplexId",
                principalSchema: "public",
                principalTable: "Complexes",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ShiftPlans_Complexes_ComplexId",
                schema: "public",
                table: "ShiftPlans");

            migrationBuilder.DropIndex(
                name: "IX_ShiftPlans_ComplexId",
                schema: "public",
                table: "ShiftPlans");

            migrationBuilder.DropColumn(
                name: "ComplexId",
                schema: "public",
                table: "ShiftPlans");
        }
    }
}
