60 lines
2.0 KiB
C#
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|