using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Infrastructure.Migrations.AppDb
{
///
public partial class AddProofBoardAndBriefing : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "Write_RequireImage",
table: "BoardMeta",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "DailyBriefing",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BriefingDate = table.Column(type: "date", nullable: false, comment: "브리핑 대상 일자 (KST, UNIQUE)"),
PostID = table.Column(type: "int", nullable: false, comment: "발행된 게시글 ID (FK Post)"),
GeneratedAt = table.Column(type: "datetime2", nullable: false, comment: "생성 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_DailyBriefing", x => x.ID);
table.ForeignKey(
name: "FK_DailyBriefing_Post_PostID",
column: x => x.PostID,
principalTable: "Post",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "장전 브리핑 발행 기록 (중복 발행 방지)");
migrationBuilder.CreateIndex(
name: "IX_DailyBriefing_BriefingDate",
table: "DailyBriefing",
column: "BriefingDate",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_DailyBriefing_PostID",
table: "DailyBriefing",
column: "PostID");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DailyBriefing");
migrationBuilder.DropColumn(
name: "Write_RequireImage",
table: "BoardMeta");
}
}
}