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