feat(schema): 게시판 대분류 BoardCategory 및 보드-카테고리 연동 추가\nchore(seed): 기본 카테고리 시드 및 보드 매핑 반영\ndocs(erd): ERD 업데이트

This commit is contained in:
mota
2025-10-13 06:29:33 +09:00
parent 173730a7c4
commit 17a071f125
4 changed files with 116 additions and 3 deletions

View File

@@ -101,6 +101,23 @@ enum Action {
// ==== Models ====
// 게시판 대분류
model BoardCategory {
id String @id @default(cuid())
name String @unique
slug String @unique
sortOrder Int @default(0)
status String @default("active")
boards Board[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([status, sortOrder])
@@map("board_categories")
}
// 게시판 정의(관리자 생성/정렬)
model Board {
id String @id @default(cuid())
@@ -120,6 +137,10 @@ model Board {
readLevel AccessLevel @default(public) // 읽기 권한
writeLevel AccessLevel @default(member) // 글쓰기 권한
// 대분류
categoryId String?
category BoardCategory? @relation(fields: [categoryId], references: [id], onDelete: SetNull)
posts Post[]
moderators BoardModerator[]
@@ -128,6 +149,7 @@ model Board {
@@index([status, sortOrder])
@@index([type, requiresApproval])
@@index([categoryId])
@@map("boards")
}