feat: add schema for admin content modules
This commit is contained in:
1 parent
9ead82bbca
commit
b9525c8e6b
3 files changed
+314
No files matched your search
@@ -2606,3 +2606,153 @@ model RadioAutoDjPlaylist {
|
||||
|
||||
@@map("radio_auto_dj_playlist")
|
||||
}
|
||||
|
||||
model WebsiteBanner {
|
||||
id Int @id @default(autoincrement())
|
||||
title String @default("")
|
||||
subtitle String @default("")
|
||||
image String @default("") @db.VarChar(500)
|
||||
link String @default("") @db.VarChar(500)
|
||||
color String @default("") @db.VarChar(20)
|
||||
isActive Int @default(1) @map("is_active")
|
||||
sortOrder Int @default(0) @map("sort_order")
|
||||
startDate String? @map("start_date") @db.VarChar(50)
|
||||
endDate String? @map("end_date") @db.VarChar(50)
|
||||
|
||||
@@map("website_banners")
|
||||
}
|
||||
|
||||
model WebsiteEventType {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar(100)
|
||||
slug String @unique @db.VarChar(100)
|
||||
description String @default("") @db.VarChar(500)
|
||||
color String @default("#3b82f6") @db.VarChar(20)
|
||||
icon String @default("calendar") @db.VarChar(50)
|
||||
isActive Int @default(1) @map("is_active")
|
||||
minRank Int @default(0) @map("min_rank")
|
||||
events WebsiteEvent[]
|
||||
|
||||
@@map("website_event_types")
|
||||
}
|
||||
|
||||
model WebsiteEvent {
|
||||
id Int @id @default(autoincrement())
|
||||
title String @db.VarChar(255)
|
||||
description String @db.Text
|
||||
typeId Int @map("type_id")
|
||||
hostUserId Int @map("host_user_id")
|
||||
roomId Int? @map("room_id")
|
||||
startsAt DateTime @map("starts_at")
|
||||
endsAt DateTime? @map("ends_at")
|
||||
maxPlayers Int? @map("max_players")
|
||||
isRecurring Int @default(0) @map("is_recurring")
|
||||
recurrenceRule String? @map("recurrence_rule") @db.VarChar(255)
|
||||
status String @default("draft") @db.VarChar(20)
|
||||
image String? @db.VarChar(500)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
type WebsiteEventType @relation(fields: [typeId], references: [id])
|
||||
registrations WebsiteEventRegistration[]
|
||||
prizes WebsiteEventPrize[]
|
||||
winners WebsiteEventWinner[]
|
||||
|
||||
@@index([typeId])
|
||||
@@index([hostUserId])
|
||||
@@index([startsAt])
|
||||
@@index([status])
|
||||
@@map("website_events")
|
||||
}
|
||||
|
||||
model WebsiteEventRegistration {
|
||||
id Int @id @default(autoincrement())
|
||||
eventId Int @map("event_id")
|
||||
userId Int @map("user_id")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
event WebsiteEvent @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([eventId, userId])
|
||||
@@index([userId])
|
||||
@@map("website_event_registrations")
|
||||
}
|
||||
|
||||
model WebsiteEventPrize {
|
||||
id Int @id @default(autoincrement())
|
||||
eventId Int @map("event_id")
|
||||
position Int @default(1)
|
||||
prizeType String @default("badge") @map("prize_type") @db.VarChar(20)
|
||||
badgeCode String? @map("badge_code") @db.VarChar(50)
|
||||
credits Int @default(0)
|
||||
pixels Int @default(0)
|
||||
points Int @default(0)
|
||||
itemId Int? @map("item_id")
|
||||
description String @default("") @db.VarChar(255)
|
||||
|
||||
event WebsiteEvent @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([eventId])
|
||||
@@map("website_event_prizes")
|
||||
}
|
||||
|
||||
model WebsiteEventWinner {
|
||||
id Int @id @default(autoincrement())
|
||||
eventId Int @map("event_id")
|
||||
userId Int @map("user_id")
|
||||
position Int @default(1)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
event WebsiteEvent @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([eventId, userId])
|
||||
@@index([userId])
|
||||
@@map("website_event_winners")
|
||||
}
|
||||
|
||||
model WebsitePoll {
|
||||
id Int @id @default(autoincrement())
|
||||
title String @db.VarChar(255)
|
||||
description String? @db.Text
|
||||
status String @default("draft") @db.VarChar(20)
|
||||
showResults Int @default(1) @map("show_results")
|
||||
multipleChoice Int @default(0) @map("multiple_choice")
|
||||
startsAt DateTime? @map("starts_at")
|
||||
endsAt DateTime? @map("ends_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
questions WebsitePollQuestion[]
|
||||
|
||||
@@index([status])
|
||||
@@map("website_polls")
|
||||
}
|
||||
|
||||
model WebsitePollQuestion {
|
||||
id Int @id @default(autoincrement())
|
||||
pollId Int @map("poll_id")
|
||||
question String @db.VarChar(500)
|
||||
type String @default("single") @db.VarChar(20)
|
||||
sortOrder Int @default(0) @map("sort_order")
|
||||
options String @db.Text
|
||||
|
||||
poll WebsitePoll @relation(fields: [pollId], references: [id], onDelete: Cascade)
|
||||
votes WebsitePollVote[]
|
||||
|
||||
@@index([pollId])
|
||||
@@map("website_poll_questions")
|
||||
}
|
||||
|
||||
model WebsitePollVote {
|
||||
id Int @id @default(autoincrement())
|
||||
questionId Int @map("question_id")
|
||||
userId Int @map("user_id")
|
||||
answer String @db.VarChar(500)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
question WebsitePollQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([questionId, userId])
|
||||
@@index([userId])
|
||||
@@map("website_poll_votes")
|
||||
}
|
||||
Reference in new issue
Block a user