This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user