using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace DataModel.Migrations { public partial class _202206MadeParentNullable : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Sections_Sections_ParentId", table: "Sections"); migrationBuilder.AlterColumn( name: "ParentId", table: "Sections", type: "INTEGER", nullable: true, oldClrType: typeof(int), oldType: "INTEGER"); migrationBuilder.AddForeignKey( name: "FK_Sections_Sections_ParentId", table: "Sections", column: "ParentId", principalTable: "Sections", principalColumn: "Id"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Sections_Sections_ParentId", table: "Sections"); migrationBuilder.AlterColumn( name: "ParentId", table: "Sections", type: "INTEGER", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "INTEGER", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_Sections_Sections_ParentId", table: "Sections", column: "ParentId", principalTable: "Sections", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }