| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066 |
- 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");
- }
- }
- }
|