인기글 추가
All checks were successful
deploy-on-main / deploy (push) Successful in 28s

This commit is contained in:
koreacomp5
2025-11-28 06:12:58 +09:00
parent c85450ce37
commit afc714022f
7 changed files with 294 additions and 14 deletions

View File

@@ -217,6 +217,7 @@ model Post {
reports Report[]
stat PostStat?
viewLogs PostViewLog[]
dailyViews DailyPostView[]
@@index([boardId, status, createdAt])
@@index([boardId, isPinned, pinnedOrder])
@@ -438,6 +439,21 @@ model PostStat {
@@map("post_stats")
}
// 일일 게시글 조회수 (날짜별 집계)
model DailyPostView {
id String @id @default(cuid())
postId String
date DateTime // 날짜만 사용 (시간은 00:00:00)
viewCount Int @default(0)
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
@@unique([postId, date])
@@index([date, viewCount])
@@index([postId, date])
@@map("daily_post_views")
}
// 신고(게시글/댓글 대상)
model Report {
id String @id @default(cuid())