using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Infrastructure.Infrastructure.Persistence.Migrations
{
///
public partial class AddForumEntities : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "BoardGroup",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Code = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "게시판 분류 주소"),
Name = table.Column(type: "nvarchar(70)", maxLength: 70, nullable: false, comment: "게시판 분류 명"),
Order = table.Column(type: "smallint", nullable: false, comment: "순서"),
Boards = table.Column(type: "smallint", nullable: false, comment: "게시판 수"),
Posts = table.Column(type: "int", nullable: false, comment: "게시글 수"),
Comments = table.Column(type: "int", nullable: false, comment: "댓글 수"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column(type: "nvarchar(450)", nullable: false),
Slug = table.Column(type: "nvarchar(450)", nullable: false),
UsageCount = table.Column(type: "bigint", nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true),
CreatedAt = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Tag", x => x.ID);
},
comment: "태그");
migrationBuilder.CreateTable(
name: "Board",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardGroupID = table.Column(type: "int", nullable: false, comment: "분류 ID"),
Code = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "게시판 주소"),
Name = table.Column(type: "nvarchar(70)", maxLength: 70, nullable: false, comment: "게시판 이름"),
Order = table.Column(type: "smallint", nullable: false, comment: "순서"),
IsSearch = table.Column(type: "bit", nullable: false, comment: "검색 여부"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
Posts = table.Column(type: "int", nullable: false, comment: "게시글 수"),
Comments = table.Column(type: "int", nullable: false, comment: "댓글 수"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardID = table.Column(type: "int", nullable: false, comment: "게시판 ID"),
MemberID = table.Column(type: "int", nullable: false, comment: "관리자 ID"),
CanEdit = table.Column(type: "bit", nullable: false, comment: "수정 권한"),
CanDelete = table.Column(type: "bit", nullable: false, comment: "삭제 권한"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardID = table.Column(type: "int", nullable: false, comment: "게시판 ID"),
List_ShowHeader = table.Column(type: "bit", nullable: false),
List_HeaderContent = table.Column(type: "nvarchar(max)", nullable: true),
List_ShowFooter = table.Column(type: "bit", nullable: false),
List_FooterContent = table.Column(type: "nvarchar(max)", nullable: true),
List_Layout = table.Column(type: "tinyint", nullable: true),
List_Sort = table.Column(type: "tinyint", nullable: true),
List_PerPage = table.Column(type: "tinyint", nullable: false),
List_AlwaysShowWriteButton = table.Column(type: "bit", nullable: false),
List_ShowFooterListView = table.Column(type: "bit", nullable: false),
List_IsNewIcon = table.Column(type: "bit", nullable: false),
List_IsHotIcon = table.Column(type: "bit", nullable: false),
List_ExceptNotice = table.Column(type: "bit", nullable: false),
List_ExceptSpeaker = table.Column(type: "bit", nullable: false),
View_AllowBookmark = table.Column(type: "bit", nullable: false),
View_AllowLike = table.Column(type: "bit", nullable: false),
View_AllowDislike = table.Column(type: "bit", nullable: false),
View_AllowPrint = table.Column(type: "bit", nullable: false),
View_AllowSnsShare = table.Column(type: "bit", nullable: false),
View_AllowPrevNextBotton = table.Column(type: "bit", nullable: false),
View_AllowBlame = table.Column(type: "bit", nullable: false),
View_BlameHideCount = table.Column(type: "int", nullable: false),
View_AllowContentLinkTargetBlank = table.Column(type: "bit", nullable: false),
View_AllowPostUrlCopy = table.Column(type: "bit", nullable: false),
View_AllowPostUrlQrCode = table.Column(type: "bit", nullable: false),
View_ShowMemberPhoto = table.Column(type: "bit", nullable: false),
View_ShowMemberIcon = table.Column(type: "bit", nullable: false),
View_ShowMemberRegDate = table.Column(type: "bit", nullable: false),
View_ShowMemberSummary = table.Column(type: "bit", nullable: false),
Write_ShowHeader = table.Column(type: "bit", nullable: false),
Write_HeaderContent = table.Column(type: "nvarchar(max)", nullable: true),
Write_ShowFooter = table.Column(type: "bit", nullable: false),
Write_FooterContent = table.Column(type: "nvarchar(max)", nullable: true),
Write_DefaultSubject = table.Column(type: "nvarchar(max)", nullable: true),
Write_DefaultContent = table.Column(type: "nvarchar(max)", nullable: true),
Write_AllowEditor = table.Column(type: "bit", nullable: false),
Write_AllowPrefix = table.Column(type: "bit", nullable: false),
Write_RequiredPrefix = table.Column(type: "bit", nullable: false),
Write_AllowSecret = table.Column(type: "bit", nullable: false),
Write_AllowTag = table.Column(type: "bit", nullable: false),
Write_TagLimit = table.Column(type: "tinyint", nullable: false),
Write_AllowImage = table.Column(type: "bit", nullable: false),
Write_ImageUploadLimit = table.Column(type: "tinyint", nullable: false),
Write_ImageUploadMaxSize = table.Column(type: "int", nullable: false),
Write_AllowMedia = table.Column(type: "bit", nullable: false),
Write_MediaUploadLimit = table.Column(type: "tinyint", nullable: false),
Write_AllowFile = table.Column(type: "bit", nullable: false),
Write_FileUploadLimit = table.Column(type: "tinyint", nullable: false),
Write_FileUploadMaxSize = table.Column(type: "int", nullable: false),
Write_FileUploadExtension = table.Column(type: "nvarchar(max)", nullable: true),
Comment_EnableComment = table.Column(type: "bit", nullable: false),
Comment_PerPage = table.Column(type: "int", nullable: false),
Comment_AllowLike = table.Column(type: "bit", nullable: false),
Comment_AllowDisLike = table.Column(type: "bit", nullable: false),
Comment_ShowMemberPhoto = table.Column(type: "bit", nullable: false),
Comment_ShowMemberIcon = table.Column(type: "bit", nullable: false),
Comment_ContentPlaceholder = table.Column(type: "nvarchar(max)", nullable: true),
Comment_MinContentLength = table.Column(type: "int", nullable: false),
Comment_MaxContentLength = table.Column(type: "int", nullable: false),
Comment_EnableEditor = table.Column(type: "bit", nullable: false),
Comment_AllowSecret = table.Column(type: "bit", nullable: false),
Comment_BlameHideCount = table.Column(type: "int", nullable: false),
Comment_DeleteProtectionDays = table.Column(type: "int", nullable: false),
Comment_UpdateProtectionDays = table.Column(type: "int", nullable: false),
Comment_AllowDeleteProtection = table.Column(type: "bit", nullable: false),
Comment_AllowUpdateProtection = table.Column(type: "bit", nullable: false),
Comment_EnableCommentUpdateLog = table.Column(type: "bit", nullable: false),
General_DeleteProtectionDays = table.Column(type: "int", nullable: false),
General_UpdateProtectionDays = table.Column(type: "int", nullable: false),
General_AllowDeleteProtection = table.Column(type: "bit", nullable: false),
General_AllowUpdateProtection = table.Column(type: "bit", nullable: false),
General_EnableFileDownLog = table.Column(type: "bit", nullable: false),
General_EnableLinkClickLog = table.Column(type: "bit", nullable: false),
General_EnablePostUpdateLog = table.Column(type: "bit", nullable: false),
Permission_BoardAccess = table.Column(type: "smallint", nullable: false),
Permission_PostView = table.Column(type: "smallint", nullable: false),
Permission_PostWrite = table.Column(type: "smallint", nullable: false),
Permission_CommentView = table.Column(type: "smallint", nullable: false),
Permission_CommentWrite = table.Column(type: "smallint", nullable: false),
Permission_ReplyWrite = table.Column(type: "smallint", nullable: false),
Permission_FileUpload = table.Column(type: "smallint", nullable: false),
Permission_FileDownload = table.Column(type: "smallint", nullable: false),
Notify_PostWriteNotify = table.Column(type: "tinyint", nullable: true),
Notify_CommentWriteNotify = table.Column(type: "tinyint", nullable: true),
Notify_ReplyWriteNotify = table.Column(type: "tinyint", nullable: true),
NotifyTemplate_PostWriteEmailNotifySubject = table.Column(type: "nvarchar(max)", nullable: true),
NotifyTemplate_PostWriteEmailNotifyContent = table.Column(type: "nvarchar(max)", nullable: true),
NotifyTemplate_CommentWriteEmailNotifySubject = table.Column(type: "nvarchar(max)", nullable: true),
NotifyTemplate_CommentWriteEmailNotifyContent = table.Column(type: "nvarchar(max)", nullable: true),
NotifyTemplate_ReplyWriteEmailNotifySubject = table.Column(type: "nvarchar(max)", nullable: true),
NotifyTemplate_ReplyWriteEmailNotifyContent = table.Column(type: "nvarchar(max)", nullable: true),
Exp_EnableExp = table.Column(type: "bit", nullable: false),
Exp_ShowExpGuide = table.Column(type: "bit", nullable: false),
Exp_PostWriteExp = table.Column(type: "int", nullable: false),
Exp_CommentWriteExp = table.Column(type: "int", nullable: false),
Exp_FileUploadExp = table.Column(type: "int", nullable: false),
Exp_FileDownloadExp = table.Column(type: "smallint", nullable: false),
Exp_OtherPostReadExp = table.Column(type: "smallint", nullable: false),
Exp_OtherPostLikeExp = table.Column(type: "int", nullable: false),
Exp_OtherPostDisLikeExp = table.Column(type: "int", nullable: false),
Exp_OtherCommentLikeExp = table.Column(type: "int", nullable: false),
Exp_OtherCommentDisLikeExp = table.Column(type: "int", nullable: false),
Exp_OwnPostReadExp = table.Column(type: "int", nullable: false),
Exp_OwnPostLikeExp = table.Column(type: "int", nullable: false),
Exp_OwnPostDisLikeExp = table.Column(type: "smallint", nullable: false),
Exp_OwnCommentLikeExp = table.Column(type: "int", nullable: false),
Exp_OwnCommentDisLikeExp = table.Column(type: "smallint", nullable: false),
Exp_PostWriteUndoExp = table.Column(type: "int", nullable: false),
Exp_CommentWriteUndoExp = table.Column(type: "int", nullable: false),
Exp_FileUploadUndoExp = table.Column(type: "int", nullable: false),
Exp_OtherPostReadUndoExp = table.Column(type: "int", nullable: false),
Exp_OtherPostLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_OtherPostDisLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_OtherCommentLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_OtherCommentDisLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_OwnPostReadUndoExp = table.Column(type: "int", nullable: false),
Exp_OwnPostLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_OwnPostDisLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_OwnCommentLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_OwnCommentDisLikeUndoExp = table.Column(type: "int", nullable: false),
Exp_PostWriteExpWithinDays = table.Column(type: "int", nullable: false),
Exp_CommentWriteExpWithinDays = table.Column(type: "int", nullable: false),
Exp_FileUploadExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OtherPostReadExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OtherPostLikeExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OtherPostDisLikeExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OtherCommentLikeExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OtherCommentDisLikeExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OwnPostReadExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OwnPostLikeExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OwnPostDisLikeExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OwnCommentLikeExpWithinDays = table.Column(type: "int", nullable: false),
Exp_OwnCommentDisLikeExpWithinDays = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardID = table.Column(type: "int", nullable: false, comment: "게시판 ID"),
Name = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "말머리"),
Color = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "색상"),
Order = table.Column(type: "smallint", nullable: false, comment: "정렬 순서"),
Posts = table.Column(type: "int", nullable: false, comment: "사용 게시글 수"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardID = table.Column(type: "int", nullable: false, comment: "게시판 ID"),
BoardPrefixID = table.Column(type: "int", nullable: true, comment: "게시글 말머리 ID"),
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
Subject = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "제목"),
Content = table.Column(type: "nvarchar(max)", maxLength: 8000, nullable: false, comment: "내용"),
SID = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "회원 SID"),
Email = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: true, comment: "회원 이메일"),
Name = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "회원 이름"),
Thumbnail = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "대표 이미지"),
IsReply = table.Column(type: "bit", nullable: false, comment: "답변 여부"),
IsAnonymous = table.Column(type: "bit", nullable: false, comment: "익명 글 여부"),
IsSecret = table.Column(type: "bit", nullable: false, comment: "비밀글 여부"),
IsNotice = table.Column(type: "bit", nullable: false, comment: "일반 공지 여부"),
IsSpeaker = table.Column(type: "bit", nullable: false, comment: "전체 공지 여부"),
IsDeleted = table.Column(type: "bit", nullable: false, comment: "삭제 여부"),
Views = table.Column(type: "int", nullable: false, comment: "조회 수"),
Likes = table.Column(type: "int", nullable: false, comment: "좋아요"),
Dislikes = table.Column(type: "int", nullable: false, comment: "싫어요"),
Comments = table.Column(type: "int", nullable: false, comment: "댓글 수"),
Bookmarks = table.Column(type: "int", nullable: false, comment: "즐겨찾기 수"),
Reports = table.Column(type: "int", nullable: false, comment: "신고 수"),
Images = table.Column(type: "tinyint", nullable: false, comment: "이미지 수"),
Medias = table.Column(type: "tinyint", nullable: false, comment: "미디어 수"),
Files = table.Column(type: "tinyint", nullable: false, comment: "파일 수"),
Tags = table.Column(type: "tinyint", nullable: false, comment: "Tag 수"),
IpAddress = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "IP"),
UserAgent = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-Agent"),
LastReplyUpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 답변 일시"),
LastCommentUpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 댓글 일시"),
DeletedAt = table.Column(type: "datetime2", nullable: true, comment: "삭제 일시"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardID = table.Column(type: "int", nullable: false, comment: "게시판 ID"),
PostID = table.Column(type: "int", nullable: false, comment: "게시글 ID"),
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
ParentID = table.Column(type: "int", nullable: true, comment: "부모 댓글 ID"),
MentionMemberID = table.Column(type: "int", nullable: true, comment: "언급 대상 회원 ID"),
Depth = table.Column(type: "smallint", nullable: false, comment: "댓글 깊이"),
Content = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false, comment: "댓글 내용"),
SID = table.Column(type: "nvarchar(max)", nullable: false),
Email = table.Column(type: "nvarchar(max)", nullable: false),
Name = table.Column(type: "nvarchar(max)", nullable: true),
IsReply = table.Column(type: "bit", nullable: false),
IsSecret = table.Column(type: "bit", nullable: false),
IsDeleted = table.Column(type: "bit", nullable: false, comment: "삭제 여부"),
Likes = table.Column(type: "int", nullable: false),
Dislikes = table.Column(type: "int", nullable: false),
Reports = table.Column(type: "int", nullable: false),
Replies = table.Column(type: "int", nullable: false),
Score = table.Column(type: "int", nullable: false, comment: "점수"),
Images = table.Column(type: "int", nullable: false),
Medias = table.Column(type: "tinyint", nullable: false),
Files = table.Column(type: "tinyint", nullable: false),
IpAddress = table.Column(type: "nvarchar(max)", nullable: true),
UserAgent = table.Column(type: "nvarchar(max)", nullable: true),
Status = table.Column(type: "tinyint", nullable: false, comment: "댓글 상태"),
DeletedAt = table.Column(type: "datetime2", nullable: true),
UpdatedAt = table.Column(type: "datetime2", nullable: true),
CreatedAt = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardID = table.Column(type: "int", nullable: false),
PostID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
IpAddress = table.Column(type: "nvarchar(max)", nullable: true),
UserAgent = table.Column(type: "nvarchar(max)", nullable: true),
CreatedAt = table.Column(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(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
BoardID = table.Column(type: "int", nullable: false),
PostID = table.Column(type: "int", nullable: false),
UUID = table.Column(type: "uniqueidentifier", nullable: false),
FileName = table.Column(type: "nvarchar(max)", nullable: false),
HashedName = table.Column(type: "nvarchar(max)", nullable: false),
Path = table.Column(type: "nvarchar(max)", nullable: false),
Url = table.Column(type: "nvarchar(max)", nullable: false),
Extension = table.Column(type: "nvarchar(max)", nullable: true),
ContentType = table.Column(type: "nvarchar(max)", nullable: true),
Size = table.Column