| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb;
- /// <inheritdoc />
- public partial class PostMemberIdNullable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Post_Member_MemberID",
- table: "Post");
- migrationBuilder.AlterColumn<int>(
- 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);
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Post_Member_MemberID",
- table: "Post");
- migrationBuilder.AlterColumn<int>(
- 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);
- }
- }
|