| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddProofBoardAndBriefing : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<bool>(
- name: "Write_RequireImage",
- table: "BoardMeta",
- type: "bit",
- nullable: false,
- defaultValue: false);
- migrationBuilder.CreateTable(
- name: "DailyBriefing",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
- .Annotation("SqlServer:Identity", "1, 1"),
- BriefingDate = table.Column<DateOnly>(type: "date", nullable: false, comment: "브리핑 대상 일자 (KST, UNIQUE)"),
- PostID = table.Column<int>(type: "int", nullable: false, comment: "발행된 게시글 ID (FK Post)"),
- GeneratedAt = table.Column<DateTime>(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");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "DailyBriefing");
- migrationBuilder.DropColumn(
- name: "Write_RequireImage",
- table: "BoardMeta");
- }
- }
- }
|