PIbd-21_Pyatakov_KM_Markov_.../UniversityDataBaseImplemet/Migrations/20230518002727_nullableEdStatusId5.cs
Danil Markov 7e3706b2f6 Documents - нужно сделать update и пофиксить delete.
многие ко многим работает (нужен фикс update и delete)
2023-05-18 04:35:12 +04:00

65 lines
2.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace UniversityDataBaseImplemet.Migrations
{
/// <inheritdoc />
public partial class nullableEdStatusId5 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EducationStatuses_User_UserId",
table: "EducationStatuses");
migrationBuilder.DropForeignKey(
name: "FK_Students_User_UserId",
table: "Students");
migrationBuilder.AddForeignKey(
name: "FK_EducationStatuses_User_UserId",
table: "EducationStatuses",
column: "UserId",
principalTable: "User",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Students_User_UserId",
table: "Students",
column: "UserId",
principalTable: "User",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EducationStatuses_User_UserId",
table: "EducationStatuses");
migrationBuilder.DropForeignKey(
name: "FK_Students_User_UserId",
table: "Students");
migrationBuilder.AddForeignKey(
name: "FK_EducationStatuses_User_UserId",
table: "EducationStatuses",
column: "UserId",
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Students_User_UserId",
table: "Students",
column: "UserId",
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}