using Microsoft.EntityFrameworkCore.Migrations;

namespace HanyadikHetVan.Data.Migrations
{
    public partial class ChangeCascadeBehavior : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_FunFacts_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "FunFacts");

            migrationBuilder.DropForeignKey(
                name: "FK_Pauses_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "Pauses");

            migrationBuilder.AddForeignKey(
                name: "FK_FunFacts_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "FunFacts",
                column: "WeeklyTimeSpanId",
                principalTable: "WeeklyTimeSpans",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Pauses_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "Pauses",
                column: "WeeklyTimeSpanId",
                principalTable: "WeeklyTimeSpans",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_FunFacts_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "FunFacts");

            migrationBuilder.DropForeignKey(
                name: "FK_Pauses_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "Pauses");

            migrationBuilder.AddForeignKey(
                name: "FK_FunFacts_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "FunFacts",
                column: "WeeklyTimeSpanId",
                principalTable: "WeeklyTimeSpans",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Pauses_WeeklyTimeSpans_WeeklyTimeSpanId",
                table: "Pauses",
                column: "WeeklyTimeSpanId",
                principalTable: "WeeklyTimeSpans",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
