PIbd-21_Pyatakov_KM_Markov_.../UniversityDataBaseImplemet/Migrations/20230517095031_nullableEdStatusId3.cs
2023-05-17 16:47:38 +04:00

60 lines
2.0 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace UniversityDataBaseImplemet.Migrations
{
/// <inheritdoc />
public partial class nullableEdStatusId3 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Students_EducationStatuses_EducationStatusId",
table: "Students");
migrationBuilder.AlterColumn<int>(
name: "EducationStatusId",
table: "Students",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AddForeignKey(
name: "FK_Students_EducationStatuses_EducationStatusId",
table: "Students",
column: "EducationStatusId",
principalTable: "EducationStatuses",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Students_EducationStatuses_EducationStatusId",
table: "Students");
migrationBuilder.AlterColumn<int>(
name: "EducationStatusId",
table: "Students",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_Students_EducationStatuses_EducationStatusId",
table: "Students",
column: "EducationStatusId",
principalTable: "EducationStatuses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}