using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Infrastructure.Infrastructure.Persistence.Migrations
{
    /// <inheritdoc />
    public partial class AddForumEntities : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BoardGroup",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "게시판 분류 주소"),
                    Name = table.Column<string>(type: "nvarchar(70)", maxLength: 70, nullable: false, comment: "게시판 분류 명"),
                    Order = table.Column<short>(type: "smallint", nullable: false, comment: "순서"),
                    Boards = table.Column<short>(type: "smallint", nullable: false, comment: "게시판 수"),
                    Posts = table.Column<int>(type: "int", nullable: false, comment: "게시글 수"),
                    Comments = table.Column<int>(type: "int", nullable: false, comment: "댓글 수"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BoardGroup", x => x.ID);
                },
                comment: "게시판 분류");

            migrationBuilder.CreateTable(
                name: "Tag",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    Slug = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    UsageCount = table.Column<long>(type: "bigint", nullable: false),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Tag", x => x.ID);
                },
                comment: "태그");

            migrationBuilder.CreateTable(
                name: "Board",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardGroupID = table.Column<int>(type: "int", nullable: false, comment: "분류 ID"),
                    Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "게시판 주소"),
                    Name = table.Column<string>(type: "nvarchar(70)", maxLength: 70, nullable: false, comment: "게시판 이름"),
                    Order = table.Column<short>(type: "smallint", nullable: false, comment: "순서"),
                    IsSearch = table.Column<bool>(type: "bit", nullable: false, comment: "검색 여부"),
                    IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
                    Posts = table.Column<int>(type: "int", nullable: false, comment: "게시글 수"),
                    Comments = table.Column<int>(type: "int", nullable: false, comment: "댓글 수"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Board", x => x.ID);
                    table.ForeignKey(
                        name: "FK_Board_BoardGroup_BoardGroupID",
                        column: x => x.BoardGroupID,
                        principalTable: "BoardGroup",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "게시판");

            migrationBuilder.CreateTable(
                name: "BoardManager",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "관리자 ID"),
                    CanEdit = table.Column<bool>(type: "bit", nullable: false, comment: "수정 권한"),
                    CanDelete = table.Column<bool>(type: "bit", nullable: false, comment: "삭제 권한"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BoardManager", x => x.ID);
                    table.ForeignKey(
                        name: "FK_BoardManager_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_BoardManager_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시판 관리자");

            migrationBuilder.CreateTable(
                name: "BoardMeta",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    List_ShowHeader = table.Column<bool>(type: "bit", nullable: false),
                    List_HeaderContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    List_ShowFooter = table.Column<bool>(type: "bit", nullable: false),
                    List_FooterContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    List_Layout = table.Column<byte>(type: "tinyint", nullable: true),
                    List_Sort = table.Column<byte>(type: "tinyint", nullable: true),
                    List_PerPage = table.Column<byte>(type: "tinyint", nullable: false),
                    List_AlwaysShowWriteButton = table.Column<bool>(type: "bit", nullable: false),
                    List_ShowFooterListView = table.Column<bool>(type: "bit", nullable: false),
                    List_IsNewIcon = table.Column<bool>(type: "bit", nullable: false),
                    List_IsHotIcon = table.Column<bool>(type: "bit", nullable: false),
                    List_ExceptNotice = table.Column<bool>(type: "bit", nullable: false),
                    List_ExceptSpeaker = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowBookmark = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowLike = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowDislike = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowPrint = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowSnsShare = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowPrevNextBotton = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowBlame = table.Column<bool>(type: "bit", nullable: false),
                    View_BlameHideCount = table.Column<int>(type: "int", nullable: false),
                    View_AllowContentLinkTargetBlank = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowPostUrlCopy = table.Column<bool>(type: "bit", nullable: false),
                    View_AllowPostUrlQrCode = table.Column<bool>(type: "bit", nullable: false),
                    View_ShowMemberPhoto = table.Column<bool>(type: "bit", nullable: false),
                    View_ShowMemberIcon = table.Column<bool>(type: "bit", nullable: false),
                    View_ShowMemberRegDate = table.Column<bool>(type: "bit", nullable: false),
                    View_ShowMemberSummary = table.Column<bool>(type: "bit", nullable: false),
                    Write_ShowHeader = table.Column<bool>(type: "bit", nullable: false),
                    Write_HeaderContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Write_ShowFooter = table.Column<bool>(type: "bit", nullable: false),
                    Write_FooterContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Write_DefaultSubject = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Write_DefaultContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Write_AllowEditor = table.Column<bool>(type: "bit", nullable: false),
                    Write_AllowPrefix = table.Column<bool>(type: "bit", nullable: false),
                    Write_RequiredPrefix = table.Column<bool>(type: "bit", nullable: false),
                    Write_AllowSecret = table.Column<bool>(type: "bit", nullable: false),
                    Write_AllowTag = table.Column<bool>(type: "bit", nullable: false),
                    Write_TagLimit = table.Column<byte>(type: "tinyint", nullable: false),
                    Write_AllowImage = table.Column<bool>(type: "bit", nullable: false),
                    Write_ImageUploadLimit = table.Column<byte>(type: "tinyint", nullable: false),
                    Write_ImageUploadMaxSize = table.Column<int>(type: "int", nullable: false),
                    Write_AllowMedia = table.Column<bool>(type: "bit", nullable: false),
                    Write_MediaUploadLimit = table.Column<byte>(type: "tinyint", nullable: false),
                    Write_AllowFile = table.Column<bool>(type: "bit", nullable: false),
                    Write_FileUploadLimit = table.Column<byte>(type: "tinyint", nullable: false),
                    Write_FileUploadMaxSize = table.Column<int>(type: "int", nullable: false),
                    Write_FileUploadExtension = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Comment_EnableComment = table.Column<bool>(type: "bit", nullable: false),
                    Comment_PerPage = table.Column<int>(type: "int", nullable: false),
                    Comment_AllowLike = table.Column<bool>(type: "bit", nullable: false),
                    Comment_AllowDisLike = table.Column<bool>(type: "bit", nullable: false),
                    Comment_ShowMemberPhoto = table.Column<bool>(type: "bit", nullable: false),
                    Comment_ShowMemberIcon = table.Column<bool>(type: "bit", nullable: false),
                    Comment_ContentPlaceholder = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Comment_MinContentLength = table.Column<int>(type: "int", nullable: false),
                    Comment_MaxContentLength = table.Column<int>(type: "int", nullable: false),
                    Comment_EnableEditor = table.Column<bool>(type: "bit", nullable: false),
                    Comment_AllowSecret = table.Column<bool>(type: "bit", nullable: false),
                    Comment_BlameHideCount = table.Column<int>(type: "int", nullable: false),
                    Comment_DeleteProtectionDays = table.Column<int>(type: "int", nullable: false),
                    Comment_UpdateProtectionDays = table.Column<int>(type: "int", nullable: false),
                    Comment_AllowDeleteProtection = table.Column<bool>(type: "bit", nullable: false),
                    Comment_AllowUpdateProtection = table.Column<bool>(type: "bit", nullable: false),
                    Comment_EnableCommentUpdateLog = table.Column<bool>(type: "bit", nullable: false),
                    General_DeleteProtectionDays = table.Column<int>(type: "int", nullable: false),
                    General_UpdateProtectionDays = table.Column<int>(type: "int", nullable: false),
                    General_AllowDeleteProtection = table.Column<bool>(type: "bit", nullable: false),
                    General_AllowUpdateProtection = table.Column<bool>(type: "bit", nullable: false),
                    General_EnableFileDownLog = table.Column<bool>(type: "bit", nullable: false),
                    General_EnableLinkClickLog = table.Column<bool>(type: "bit", nullable: false),
                    General_EnablePostUpdateLog = table.Column<bool>(type: "bit", nullable: false),
                    Permission_BoardAccess = table.Column<short>(type: "smallint", nullable: false),
                    Permission_PostView = table.Column<short>(type: "smallint", nullable: false),
                    Permission_PostWrite = table.Column<short>(type: "smallint", nullable: false),
                    Permission_CommentView = table.Column<short>(type: "smallint", nullable: false),
                    Permission_CommentWrite = table.Column<short>(type: "smallint", nullable: false),
                    Permission_ReplyWrite = table.Column<short>(type: "smallint", nullable: false),
                    Permission_FileUpload = table.Column<short>(type: "smallint", nullable: false),
                    Permission_FileDownload = table.Column<short>(type: "smallint", nullable: false),
                    Notify_PostWriteNotify = table.Column<byte>(type: "tinyint", nullable: true),
                    Notify_CommentWriteNotify = table.Column<byte>(type: "tinyint", nullable: true),
                    Notify_ReplyWriteNotify = table.Column<byte>(type: "tinyint", nullable: true),
                    NotifyTemplate_PostWriteEmailNotifySubject = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NotifyTemplate_PostWriteEmailNotifyContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NotifyTemplate_CommentWriteEmailNotifySubject = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NotifyTemplate_CommentWriteEmailNotifyContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NotifyTemplate_ReplyWriteEmailNotifySubject = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NotifyTemplate_ReplyWriteEmailNotifyContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Exp_EnableExp = table.Column<bool>(type: "bit", nullable: false),
                    Exp_ShowExpGuide = table.Column<bool>(type: "bit", nullable: false),
                    Exp_PostWriteExp = table.Column<int>(type: "int", nullable: false),
                    Exp_CommentWriteExp = table.Column<int>(type: "int", nullable: false),
                    Exp_FileUploadExp = table.Column<int>(type: "int", nullable: false),
                    Exp_FileDownloadExp = table.Column<short>(type: "smallint", nullable: false),
                    Exp_OtherPostReadExp = table.Column<short>(type: "smallint", nullable: false),
                    Exp_OtherPostLikeExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherPostDisLikeExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherCommentLikeExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherCommentDisLikeExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostReadExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostLikeExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostDisLikeExp = table.Column<short>(type: "smallint", nullable: false),
                    Exp_OwnCommentLikeExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnCommentDisLikeExp = table.Column<short>(type: "smallint", nullable: false),
                    Exp_PostWriteUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_CommentWriteUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_FileUploadUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherPostReadUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherPostLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherPostDisLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherCommentLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherCommentDisLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostReadUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostDisLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnCommentLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnCommentDisLikeUndoExp = table.Column<int>(type: "int", nullable: false),
                    Exp_PostWriteExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_CommentWriteExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_FileUploadExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherPostReadExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherPostLikeExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherPostDisLikeExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherCommentLikeExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OtherCommentDisLikeExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostReadExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostLikeExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnPostDisLikeExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnCommentLikeExpWithinDays = table.Column<int>(type: "int", nullable: false),
                    Exp_OwnCommentDisLikeExpWithinDays = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BoardMeta", x => x.ID);
                    table.ForeignKey(
                        name: "FK_BoardMeta_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시판 설정");

            migrationBuilder.CreateTable(
                name: "BoardPrefix",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "말머리"),
                    Color = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "색상"),
                    Order = table.Column<short>(type: "smallint", nullable: false, comment: "정렬 순서"),
                    Posts = table.Column<int>(type: "int", nullable: false, comment: "사용 게시글 수"),
                    IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BoardPrefix", x => x.ID);
                    table.ForeignKey(
                        name: "FK_BoardPrefix_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시판 말머리");

            migrationBuilder.CreateTable(
                name: "Post",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    BoardPrefixID = table.Column<int>(type: "int", nullable: true, comment: "게시글 말머리 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    Subject = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "제목"),
                    Content = table.Column<string>(type: "nvarchar(max)", maxLength: 8000, nullable: false, comment: "내용"),
                    SID = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "회원 SID"),
                    Email = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: true, comment: "회원 이메일"),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "회원 이름"),
                    Thumbnail = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "대표 이미지"),
                    IsReply = table.Column<bool>(type: "bit", nullable: false, comment: "답변 여부"),
                    IsAnonymous = table.Column<bool>(type: "bit", nullable: false, comment: "익명 글 여부"),
                    IsSecret = table.Column<bool>(type: "bit", nullable: false, comment: "비밀글 여부"),
                    IsNotice = table.Column<bool>(type: "bit", nullable: false, comment: "일반 공지 여부"),
                    IsSpeaker = table.Column<bool>(type: "bit", nullable: false, comment: "전체 공지 여부"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "삭제 여부"),
                    Views = table.Column<int>(type: "int", nullable: false, comment: "조회 수"),
                    Likes = table.Column<int>(type: "int", nullable: false, comment: "좋아요"),
                    Dislikes = table.Column<int>(type: "int", nullable: false, comment: "싫어요"),
                    Comments = table.Column<int>(type: "int", nullable: false, comment: "댓글 수"),
                    Bookmarks = table.Column<int>(type: "int", nullable: false, comment: "즐겨찾기 수"),
                    Reports = table.Column<int>(type: "int", nullable: false, comment: "신고 수"),
                    Images = table.Column<byte>(type: "tinyint", nullable: false, comment: "이미지 수"),
                    Medias = table.Column<byte>(type: "tinyint", nullable: false, comment: "미디어 수"),
                    Files = table.Column<byte>(type: "tinyint", nullable: false, comment: "파일 수"),
                    Tags = table.Column<byte>(type: "tinyint", nullable: false, comment: "Tag 수"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
                    LastReplyUpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "마지막 답변 일시"),
                    LastCommentUpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "마지막 댓글 일시"),
                    DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "삭제 일시"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Post", x => x.ID);
                    table.ForeignKey(
                        name: "FK_Post_BoardPrefix_BoardPrefixID",
                        column: x => x.BoardPrefixID,
                        principalTable: "BoardPrefix",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.SetNull);
                    table.ForeignKey(
                        name: "FK_Post_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_Post_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "게시글");

            migrationBuilder.CreateTable(
                name: "Comment",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    ParentID = table.Column<int>(type: "int", nullable: true, comment: "부모 댓글 ID"),
                    MentionMemberID = table.Column<int>(type: "int", nullable: true, comment: "언급 대상 회원 ID"),
                    Depth = table.Column<short>(type: "smallint", nullable: false, comment: "댓글 깊이"),
                    Content = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: false, comment: "댓글 내용"),
                    SID = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsReply = table.Column<bool>(type: "bit", nullable: false),
                    IsSecret = table.Column<bool>(type: "bit", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "삭제 여부"),
                    Likes = table.Column<int>(type: "int", nullable: false),
                    Dislikes = table.Column<int>(type: "int", nullable: false),
                    Reports = table.Column<int>(type: "int", nullable: false),
                    Replies = table.Column<int>(type: "int", nullable: false),
                    Score = table.Column<int>(type: "int", nullable: false, comment: "점수"),
                    Images = table.Column<int>(type: "int", nullable: false),
                    Medias = table.Column<byte>(type: "tinyint", nullable: false),
                    Files = table.Column<byte>(type: "tinyint", nullable: false),
                    IpAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserAgent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<byte>(type: "tinyint", nullable: false, comment: "댓글 상태"),
                    DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Comment", x => x.ID);
                    table.ForeignKey(
                        name: "FK_Comment_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_Comment_Comment_ParentID",
                        column: x => x.ParentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_Comment_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_Comment_Member_MentionMemberID",
                        column: x => x.MentionMemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.SetNull);
                    table.ForeignKey(
                        name: "FK_Comment_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "댓글");

            migrationBuilder.CreateTable(
                name: "PostBookmark",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    MemberID = table.Column<int>(type: "int", nullable: false),
                    IpAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserAgent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostBookmark", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostBookmark_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostBookmark_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_PostBookmark_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 즐겨찾기");

            migrationBuilder.CreateTable(
                name: "PostFile",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    UUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    FileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HashedName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Extension = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContentType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Size = table.Column<long>(type: "bigint", nullable: true),
                    Downloads = table.Column<int>(type: "int", nullable: false),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostFile", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostFile_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostFile_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 파일");

            migrationBuilder.CreateTable(
                name: "PostImage",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    UUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "이미지 ID"),
                    FileName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "원본 파일명"),
                    HashedName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "저장 파일명"),
                    Path = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "저장 경로"),
                    Url = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false, comment: "URL"),
                    Extension = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "확장자"),
                    ContentType = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "MIME 타입"),
                    Size = table.Column<long>(type: "bigint", nullable: true, comment: "용량(byte)"),
                    Width = table.Column<short>(type: "smallint", nullable: true, comment: "가로 해상도(px)"),
                    Height = table.Column<short>(type: "smallint", nullable: true, comment: "세로 해상도(px)"),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false, comment: "비활성 여부"),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "비활성 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostImage", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostImage_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostImage_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 이미지");

            migrationBuilder.CreateTable(
                name: "PostLink",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    UUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Clicks = table.Column<int>(type: "int", nullable: false),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostLink", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostLink_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostLink_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 링크");

            migrationBuilder.CreateTable(
                name: "PostMedia",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostMedia", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostMedia_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostMedia_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 미디어");

            migrationBuilder.CreateTable(
                name: "PostReaction",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    Reaction = table.Column<byte>(type: "tinyint", nullable: false, comment: "반응 구분"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-agent"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostReaction", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostReaction_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostReaction_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_PostReaction_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 반응");

            migrationBuilder.CreateTable(
                name: "PostReport",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    Type = table.Column<byte>(type: "tinyint", nullable: false, comment: "신고 사유"),
                    Reason = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "신고 내용"),
                    Status = table.Column<byte>(type: "tinyint", nullable: false, comment: "처리 상태"),
                    Memo = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "처리 내용"),
                    IpAddress = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-agent"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostReport", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostReport_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostReport_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_PostReport_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 신고");

            migrationBuilder.CreateTable(
                name: "PostTag",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    TagID = table.Column<int>(type: "int", nullable: false),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostTag", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostTag_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostTag_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_PostTag_Tag_TagID",
                        column: x => x.TagID,
                        principalTable: "Tag",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 태그 연결");

            migrationBuilder.CreateTable(
                name: "PostUpdateLog",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    SubjectDiff = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true, comment: "변경 제목"),
                    ContentDiff = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true, comment: "변경 내용"),
                    Note = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "비고"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostUpdateLog", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostUpdateLog_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_PostUpdateLog_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 수정 로그");

            migrationBuilder.CreateTable(
                name: "CommentFile",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    CommentID = table.Column<int>(type: "int", nullable: false),
                    UUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    FileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HashedName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Extension = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContentType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Size = table.Column<long>(type: "bigint", nullable: true),
                    Downloads = table.Column<int>(type: "int", nullable: false),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentFile", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentFile_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentFile_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentFile_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 파일");

            migrationBuilder.CreateTable(
                name: "CommentImage",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    CommentID = table.Column<int>(type: "int", nullable: false),
                    UUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    FileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HashedName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Extension = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContentType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Size = table.Column<long>(type: "bigint", nullable: true),
                    Width = table.Column<short>(type: "smallint", nullable: true),
                    Height = table.Column<short>(type: "smallint", nullable: true),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentImage", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentImage_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentImage_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentImage_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 이미지");

            migrationBuilder.CreateTable(
                name: "CommentLink",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    CommentID = table.Column<int>(type: "int", nullable: false),
                    UUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Clicks = table.Column<int>(type: "int", nullable: false),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentLink", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentLink_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentLink_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentLink_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 링크");

            migrationBuilder.CreateTable(
                name: "CommentMedia",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false),
                    PostID = table.Column<int>(type: "int", nullable: false),
                    CommentID = table.Column<int>(type: "int", nullable: false),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false),
                    DisabledAt = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentMedia", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentMedia_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentMedia_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentMedia_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 미디어");

            migrationBuilder.CreateTable(
                name: "CommentMention",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    CommentID = table.Column<int>(type: "int", nullable: false, comment: "댓글 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "언급된 회원 ID"),
                    RawHandle = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false, comment: "원문 회원 언급값"),
                    Start = table.Column<int>(type: "int", nullable: false, comment: "본문 내 시작 인덱스"),
                    Length = table.Column<int>(type: "int", nullable: false, comment: "길이"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentMention", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentMention_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentMention_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentMention_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentMention_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 멘션");

            migrationBuilder.CreateTable(
                name: "CommentReaction",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    CommentID = table.Column<int>(type: "int", nullable: false, comment: "댓글 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    Reaction = table.Column<byte>(type: "tinyint", nullable: false, comment: "반응 구분"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-agent"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentReaction", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentReaction_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentReaction_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentReaction_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentReaction_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 반응");

            migrationBuilder.CreateTable(
                name: "CommentReport",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoardID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    CommentID = table.Column<int>(type: "int", nullable: false, comment: "댓글 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    Type = table.Column<byte>(type: "tinyint", nullable: false, comment: "신고 사유"),
                    Reason = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "신고 내용"),
                    Status = table.Column<byte>(type: "tinyint", nullable: false, comment: "처리 상태"),
                    Memo = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "처리 내용"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-agent"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentReport", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentReport_Board_BoardID",
                        column: x => x.BoardID,
                        principalTable: "Board",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentReport_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentReport_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentReport_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 신고");

            migrationBuilder.CreateTable(
                name: "CommentUpdateLog",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CommentID = table.Column<int>(type: "int", nullable: false, comment: "댓글 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
                    ContentDiff = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true, comment: "변경 내용"),
                    Note = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "비고"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentUpdateLog", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentUpdateLog_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentUpdateLog_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "댓글 수정 로그");

            migrationBuilder.CreateTable(
                name: "PostFileDownLog",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시글 ID"),
                    PostFileID = table.Column<int>(type: "int", nullable: false, comment: "게시글 파일 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: true, comment: "회원 ID"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostFileDownLog", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostFileDownLog_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostFileDownLog_PostFile_PostFileID",
                        column: x => x.PostFileID,
                        principalTable: "PostFile",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostFileDownLog_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 파일 다운로드 로그");

            migrationBuilder.CreateTable(
                name: "PostLinkClickLog",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PostID = table.Column<int>(type: "int", nullable: false, comment: "게시판 ID"),
                    PostLinkID = table.Column<int>(type: "int", nullable: false, comment: "게시글 파일 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: true, comment: "회원 ID"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PostLinkClickLog", x => x.ID);
                    table.ForeignKey(
                        name: "FK_PostLinkClickLog_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostLinkClickLog_PostLink_PostLinkID",
                        column: x => x.PostLinkID,
                        principalTable: "PostLink",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_PostLinkClickLog_Post_PostID",
                        column: x => x.PostID,
                        principalTable: "Post",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "게시글 링크 클릭 로그");

            migrationBuilder.CreateTable(
                name: "CommentFileDownLog",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CommentID = table.Column<int>(type: "int", nullable: false, comment: "댓글 ID"),
                    CommentFileID = table.Column<int>(type: "int", nullable: false, comment: "댓글 파일 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: true, comment: "회원 ID"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentFileDownLog", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentFileDownLog_CommentFile_CommentFileID",
                        column: x => x.CommentFileID,
                        principalTable: "CommentFile",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentFileDownLog_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentFileDownLog_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 파일 다운로드 로그");

            migrationBuilder.CreateTable(
                name: "CommentLinkClickLog",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CommentID = table.Column<int>(type: "int", nullable: false, comment: "댓글 ID"),
                    CommentLinkID = table.Column<int>(type: "int", nullable: false, comment: "댓글 링크 ID"),
                    MemberID = table.Column<int>(type: "int", nullable: true, comment: "회원 ID"),
                    IpAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP Address"),
                    UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
                    CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommentLinkClickLog", x => x.ID);
                    table.ForeignKey(
                        name: "FK_CommentLinkClickLog_CommentLink_CommentLinkID",
                        column: x => x.CommentLinkID,
                        principalTable: "CommentLink",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_CommentLinkClickLog_Comment_CommentID",
                        column: x => x.CommentID,
                        principalTable: "Comment",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_CommentLinkClickLog_Member_MemberID",
                        column: x => x.MemberID,
                        principalTable: "Member",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "댓글 링크 클릭 로그");

            migrationBuilder.CreateIndex(
                name: "IX_Board_BoardGroupID",
                table: "Board",
                column: "BoardGroupID");

            migrationBuilder.CreateIndex(
                name: "IX_Board_Code",
                table: "Board",
                column: "Code",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_Board_Code_IsActive",
                table: "Board",
                columns: new[] { "Code", "IsActive" });

            migrationBuilder.CreateIndex(
                name: "IX_Board_Code_IsSearch",
                table: "Board",
                columns: new[] { "Code", "IsSearch" });

            migrationBuilder.CreateIndex(
                name: "IX_Board_Comments",
                table: "Board",
                column: "Comments");

            migrationBuilder.CreateIndex(
                name: "IX_Board_IsActive",
                table: "Board",
                column: "IsActive");

            migrationBuilder.CreateIndex(
                name: "IX_Board_IsSearch",
                table: "Board",
                column: "IsSearch");

            migrationBuilder.CreateIndex(
                name: "IX_Board_IsSearch_IsActive",
                table: "Board",
                columns: new[] { "IsSearch", "IsActive" });

            migrationBuilder.CreateIndex(
                name: "IX_Board_Name",
                table: "Board",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_Board_Order",
                table: "Board",
                column: "Order");

            migrationBuilder.CreateIndex(
                name: "IX_Board_Posts",
                table: "Board",
                column: "Posts");

            migrationBuilder.CreateIndex(
                name: "IX_BoardGroup_Code",
                table: "BoardGroup",
                column: "Code",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_BoardGroup_Code_Order_CreatedAt",
                table: "BoardGroup",
                columns: new[] { "Code", "Order", "CreatedAt" });

            migrationBuilder.CreateIndex(
                name: "IX_BoardGroup_Order",
                table: "BoardGroup",
                column: "Order");

            migrationBuilder.CreateIndex(
                name: "IX_BoardGroup_Order_CreatedAt",
                table: "BoardGroup",
                columns: new[] { "Order", "CreatedAt" });

            migrationBuilder.CreateIndex(
                name: "IX_BoardManager_BoardID",
                table: "BoardManager",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_BoardManager_BoardID_MemberID",
                table: "BoardManager",
                columns: new[] { "BoardID", "MemberID" });

            migrationBuilder.CreateIndex(
                name: "IX_BoardManager_MemberID",
                table: "BoardManager",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_BoardMeta_BoardID",
                table: "BoardMeta",
                column: "BoardID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_BoardPrefix_BoardID_IsActive_Order_CreatedAt",
                table: "BoardPrefix",
                columns: new[] { "BoardID", "IsActive", "Order", "CreatedAt" });

            migrationBuilder.CreateIndex(
                name: "IX_Comment_BoardID",
                table: "Comment",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_Comment_MemberID",
                table: "Comment",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_Comment_MentionMemberID",
                table: "Comment",
                column: "MentionMemberID");

            migrationBuilder.CreateIndex(
                name: "IX_Comment_ParentID",
                table: "Comment",
                column: "ParentID");

            migrationBuilder.CreateIndex(
                name: "IX_Comment_PostID",
                table: "Comment",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_Comment_PostID_IsDeleted_ParentID_CreatedAt",
                table: "Comment",
                columns: new[] { "PostID", "IsDeleted", "ParentID", "CreatedAt" },
                descending: new[] { false, false, false, true });

            migrationBuilder.CreateIndex(
                name: "IX_Comment_PostID_IsDeleted_ParentID_Score_ID",
                table: "Comment",
                columns: new[] { "PostID", "IsDeleted", "ParentID", "Score", "ID" },
                descending: new[] { false, false, false, true, true });

            migrationBuilder.CreateIndex(
                name: "IX_Comment_PostID_MemberID_IsDeleted_ParentID_CreatedAt",
                table: "Comment",
                columns: new[] { "PostID", "MemberID", "IsDeleted", "ParentID", "CreatedAt" },
                descending: new[] { false, false, false, false, true });

            migrationBuilder.CreateIndex(
                name: "IX_Comment_PostID_MemberID_IsDeleted_ParentID_Score_ID",
                table: "Comment",
                columns: new[] { "PostID", "MemberID", "IsDeleted", "ParentID", "Score", "ID" },
                descending: new[] { false, false, false, false, true, true });

            migrationBuilder.CreateIndex(
                name: "IX_CommentFile_BoardID",
                table: "CommentFile",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentFile_CommentID",
                table: "CommentFile",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentFile_PostID",
                table: "CommentFile",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentFile_UUID",
                table: "CommentFile",
                column: "UUID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_CommentFileDownLog_CommentFileID",
                table: "CommentFileDownLog",
                column: "CommentFileID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentFileDownLog_CommentID",
                table: "CommentFileDownLog",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentFileDownLog_CommentID_CommentFileID",
                table: "CommentFileDownLog",
                columns: new[] { "CommentID", "CommentFileID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentFileDownLog_CommentID_CommentFileID_MemberID",
                table: "CommentFileDownLog",
                columns: new[] { "CommentID", "CommentFileID", "MemberID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentFileDownLog_MemberID",
                table: "CommentFileDownLog",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentImage_BoardID",
                table: "CommentImage",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentImage_CommentID",
                table: "CommentImage",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentImage_PostID",
                table: "CommentImage",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentImage_UUID",
                table: "CommentImage",
                column: "UUID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_CommentLink_BoardID",
                table: "CommentLink",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentLink_CommentID",
                table: "CommentLink",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentLink_PostID",
                table: "CommentLink",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentLinkClickLog_CommentID",
                table: "CommentLinkClickLog",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentLinkClickLog_CommentID_CommentLinkID",
                table: "CommentLinkClickLog",
                columns: new[] { "CommentID", "CommentLinkID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentLinkClickLog_CommentID_CommentLinkID_MemberID",
                table: "CommentLinkClickLog",
                columns: new[] { "CommentID", "CommentLinkID", "MemberID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentLinkClickLog_CommentLinkID",
                table: "CommentLinkClickLog",
                column: "CommentLinkID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentLinkClickLog_MemberID",
                table: "CommentLinkClickLog",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentMedia_BoardID",
                table: "CommentMedia",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentMedia_CommentID",
                table: "CommentMedia",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentMedia_PostID",
                table: "CommentMedia",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentMention_BoardID",
                table: "CommentMention",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentMention_CommentID",
                table: "CommentMention",
                column: "CommentID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_CommentMention_CommentID_ID",
                table: "CommentMention",
                columns: new[] { "CommentID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentMention_CommentID_MemberID_ID",
                table: "CommentMention",
                columns: new[] { "CommentID", "MemberID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentMention_CommentID_MemberID_Start",
                table: "CommentMention",
                columns: new[] { "CommentID", "MemberID", "Start" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentMention_MemberID",
                table: "CommentMention",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentMention_PostID",
                table: "CommentMention",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_BoardID",
                table: "CommentReaction",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_CommentID",
                table: "CommentReaction",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_CommentID_ID",
                table: "CommentReaction",
                columns: new[] { "CommentID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_CommentID_MemberID",
                table: "CommentReaction",
                columns: new[] { "CommentID", "MemberID" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_CreatedAt",
                table: "CommentReaction",
                column: "CreatedAt");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_MemberID",
                table: "CommentReaction",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_PostID",
                table: "CommentReaction",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReaction_Reaction",
                table: "CommentReaction",
                column: "Reaction");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_BoardID",
                table: "CommentReport",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_CommentID",
                table: "CommentReport",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_CommentID_ID",
                table: "CommentReport",
                columns: new[] { "CommentID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_CommentID_MemberID",
                table: "CommentReport",
                columns: new[] { "CommentID", "MemberID" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_CreatedAt",
                table: "CommentReport",
                column: "CreatedAt");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_MemberID",
                table: "CommentReport",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_PostID",
                table: "CommentReport",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_Status",
                table: "CommentReport",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_CommentReport_Type",
                table: "CommentReport",
                column: "Type");

            migrationBuilder.CreateIndex(
                name: "IX_CommentUpdateLog_CommentID",
                table: "CommentUpdateLog",
                column: "CommentID");

            migrationBuilder.CreateIndex(
                name: "IX_CommentUpdateLog_CommentID_ID",
                table: "CommentUpdateLog",
                columns: new[] { "CommentID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentUpdateLog_CommentID_MemberID",
                table: "CommentUpdateLog",
                columns: new[] { "CommentID", "MemberID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentUpdateLog_CommentID_MemberID_ID",
                table: "CommentUpdateLog",
                columns: new[] { "CommentID", "MemberID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_CommentUpdateLog_ContentDiff",
                table: "CommentUpdateLog",
                column: "ContentDiff");

            migrationBuilder.CreateIndex(
                name: "IX_CommentUpdateLog_MemberID",
                table: "CommentUpdateLog",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_Post_BoardID",
                table: "Post",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_Post_BoardPrefixID",
                table: "Post",
                column: "BoardPrefixID");

            migrationBuilder.CreateIndex(
                name: "IX_Post_ID_BoardID",
                table: "Post",
                columns: new[] { "ID", "BoardID" });

            migrationBuilder.CreateIndex(
                name: "IX_Post_ID_BoardID_BoardPrefixID_IsDeleted_Comments",
                table: "Post",
                columns: new[] { "ID", "BoardID", "BoardPrefixID", "IsDeleted", "Comments" });

            migrationBuilder.CreateIndex(
                name: "IX_Post_ID_BoardID_BoardPrefixID_IsDeleted_CreatedAt",
                table: "Post",
                columns: new[] { "ID", "BoardID", "BoardPrefixID", "IsDeleted", "CreatedAt" });

            migrationBuilder.CreateIndex(
                name: "IX_Post_ID_BoardID_BoardPrefixID_IsDeleted_Likes",
                table: "Post",
                columns: new[] { "ID", "BoardID", "BoardPrefixID", "IsDeleted", "Likes" });

            migrationBuilder.CreateIndex(
                name: "IX_Post_ID_BoardID_BoardPrefixID_IsDeleted_Views",
                table: "Post",
                columns: new[] { "ID", "BoardID", "BoardPrefixID", "IsDeleted", "Views" });

            migrationBuilder.CreateIndex(
                name: "IX_Post_ID_BoardID_IsDeleted",
                table: "Post",
                columns: new[] { "ID", "BoardID", "IsDeleted" });

            migrationBuilder.CreateIndex(
                name: "IX_Post_MemberID",
                table: "Post",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_PostBookmark_BoardID",
                table: "PostBookmark",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostBookmark_MemberID",
                table: "PostBookmark",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_PostBookmark_PostID",
                table: "PostBookmark",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostBookmark_PostID_MemberID",
                table: "PostBookmark",
                columns: new[] { "PostID", "MemberID" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_PostFile_BoardID",
                table: "PostFile",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostFile_PostID",
                table: "PostFile",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostFile_UUID",
                table: "PostFile",
                column: "UUID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_PostFileDownLog_MemberID",
                table: "PostFileDownLog",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_PostFileDownLog_PostFileID",
                table: "PostFileDownLog",
                column: "PostFileID");

            migrationBuilder.CreateIndex(
                name: "IX_PostFileDownLog_PostID",
                table: "PostFileDownLog",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostFileDownLog_PostID_PostFileID",
                table: "PostFileDownLog",
                columns: new[] { "PostID", "PostFileID" });

            migrationBuilder.CreateIndex(
                name: "IX_PostFileDownLog_PostID_PostFileID_MemberID",
                table: "PostFileDownLog",
                columns: new[] { "PostID", "PostFileID", "MemberID" });

            migrationBuilder.CreateIndex(
                name: "IX_PostImage_BoardID",
                table: "PostImage",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostImage_PostID",
                table: "PostImage",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostImage_PostID_HashedName",
                table: "PostImage",
                columns: new[] { "PostID", "HashedName" });

            migrationBuilder.CreateIndex(
                name: "IX_PostImage_PostID_HashedName_IsDisabled",
                table: "PostImage",
                columns: new[] { "PostID", "HashedName", "IsDisabled" });

            migrationBuilder.CreateIndex(
                name: "IX_PostImage_UUID",
                table: "PostImage",
                column: "UUID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_PostLink_BoardID",
                table: "PostLink",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostLink_PostID",
                table: "PostLink",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostLinkClickLog_MemberID",
                table: "PostLinkClickLog",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_PostLinkClickLog_PostID",
                table: "PostLinkClickLog",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostLinkClickLog_PostID_PostLinkID",
                table: "PostLinkClickLog",
                columns: new[] { "PostID", "PostLinkID" });

            migrationBuilder.CreateIndex(
                name: "IX_PostLinkClickLog_PostID_PostLinkID_MemberID",
                table: "PostLinkClickLog",
                columns: new[] { "PostID", "PostLinkID", "MemberID" });

            migrationBuilder.CreateIndex(
                name: "IX_PostLinkClickLog_PostLinkID",
                table: "PostLinkClickLog",
                column: "PostLinkID");

            migrationBuilder.CreateIndex(
                name: "IX_PostMedia_BoardID",
                table: "PostMedia",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostMedia_PostID",
                table: "PostMedia",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostReaction_BoardID",
                table: "PostReaction",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostReaction_MemberID",
                table: "PostReaction",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_PostReaction_PostID",
                table: "PostReaction",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostReaction_PostID_MemberID",
                table: "PostReaction",
                columns: new[] { "PostID", "MemberID" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_PostReaction_Reaction",
                table: "PostReaction",
                column: "Reaction");

            migrationBuilder.CreateIndex(
                name: "IX_PostReport_BoardID",
                table: "PostReport",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostReport_MemberID",
                table: "PostReport",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_PostReport_PostID",
                table: "PostReport",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostReport_PostID_MemberID",
                table: "PostReport",
                columns: new[] { "PostID", "MemberID" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_PostReport_Status",
                table: "PostReport",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_PostReport_Type",
                table: "PostReport",
                column: "Type");

            migrationBuilder.CreateIndex(
                name: "IX_PostTag_BoardID",
                table: "PostTag",
                column: "BoardID");

            migrationBuilder.CreateIndex(
                name: "IX_PostTag_PostID",
                table: "PostTag",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostTag_TagID",
                table: "PostTag",
                column: "TagID");

            migrationBuilder.CreateIndex(
                name: "IX_PostUpdateLog_ContentDiff",
                table: "PostUpdateLog",
                column: "ContentDiff");

            migrationBuilder.CreateIndex(
                name: "IX_PostUpdateLog_MemberID",
                table: "PostUpdateLog",
                column: "MemberID");

            migrationBuilder.CreateIndex(
                name: "IX_PostUpdateLog_PostID",
                table: "PostUpdateLog",
                column: "PostID");

            migrationBuilder.CreateIndex(
                name: "IX_PostUpdateLog_PostID_ID",
                table: "PostUpdateLog",
                columns: new[] { "PostID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_PostUpdateLog_PostID_MemberID",
                table: "PostUpdateLog",
                columns: new[] { "PostID", "MemberID" });

            migrationBuilder.CreateIndex(
                name: "IX_PostUpdateLog_PostID_MemberID_ID",
                table: "PostUpdateLog",
                columns: new[] { "PostID", "MemberID", "ID" });

            migrationBuilder.CreateIndex(
                name: "IX_PostUpdateLog_SubjectDiff",
                table: "PostUpdateLog",
                column: "SubjectDiff");

            migrationBuilder.CreateIndex(
                name: "IX_Tag_Name",
                table: "Tag",
                column: "Name",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_Tag_Slug",
                table: "Tag",
                column: "Slug",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_Tag_UsageCount",
                table: "Tag",
                column: "UsageCount");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BoardManager");

            migrationBuilder.DropTable(
                name: "BoardMeta");

            migrationBuilder.DropTable(
                name: "CommentFileDownLog");

            migrationBuilder.DropTable(
                name: "CommentImage");

            migrationBuilder.DropTable(
                name: "CommentLinkClickLog");

            migrationBuilder.DropTable(
                name: "CommentMedia");

            migrationBuilder.DropTable(
                name: "CommentMention");

            migrationBuilder.DropTable(
                name: "CommentReaction");

            migrationBuilder.DropTable(
                name: "CommentReport");

            migrationBuilder.DropTable(
                name: "CommentUpdateLog");

            migrationBuilder.DropTable(
                name: "PostBookmark");

            migrationBuilder.DropTable(
                name: "PostFileDownLog");

            migrationBuilder.DropTable(
                name: "PostImage");

            migrationBuilder.DropTable(
                name: "PostLinkClickLog");

            migrationBuilder.DropTable(
                name: "PostMedia");

            migrationBuilder.DropTable(
                name: "PostReaction");

            migrationBuilder.DropTable(
                name: "PostReport");

            migrationBuilder.DropTable(
                name: "PostTag");

            migrationBuilder.DropTable(
                name: "PostUpdateLog");

            migrationBuilder.DropTable(
                name: "CommentFile");

            migrationBuilder.DropTable(
                name: "CommentLink");

            migrationBuilder.DropTable(
                name: "PostFile");

            migrationBuilder.DropTable(
                name: "PostLink");

            migrationBuilder.DropTable(
                name: "Tag");

            migrationBuilder.DropTable(
                name: "Comment");

            migrationBuilder.DropTable(
                name: "Post");

            migrationBuilder.DropTable(
                name: "BoardPrefix");

            migrationBuilder.DropTable(
                name: "Board");

            migrationBuilder.DropTable(
                name: "BoardGroup");
        }
    }
}
