using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Infrastructure.Migrations.AppDb { /// public partial class PostMemberIdNullable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Post_Member_MemberID", table: "Post"); migrationBuilder.AlterColumn( name: "MemberID", table: "Post", type: "int", nullable: true, comment: "회원 ID", oldClrType: typeof(int), oldType: "int", oldComment: "회원 ID"); migrationBuilder.AddForeignKey( name: "FK_Post_Member_MemberID", table: "Post", column: "MemberID", principalTable: "Member", principalColumn: "ID", onDelete: ReferentialAction.SetNull); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Post_Member_MemberID", table: "Post"); migrationBuilder.AlterColumn( name: "MemberID", table: "Post", type: "int", nullable: false, defaultValue: 0, comment: "회원 ID", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "회원 ID"); migrationBuilder.AddForeignKey( name: "FK_Post_Member_MemberID", table: "Post", column: "MemberID", principalTable: "Member", principalColumn: "ID", onDelete: ReferentialAction.Restrict); } } }