hanyadikhetvan-dotnethf/HanyadikHetVan/Data/Migrations/20210519232012_ChangeCascadeBehavior.cs
Torma Kristóf 10c1bb008f
All checks were successful
continuous-integration/drone/push Build is passing
final
2021-05-20 01:36:54 +02:00

62 lines
2.2 KiB
C#

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);
}
}
}