216 lines
5.2 KiB
Plaintext
216 lines
5.2 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
binaryTargets = ["native", "debian-openssl-3.0.x"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model GuildSettings {
|
|
guildId String @id
|
|
welcomeChannelId String?
|
|
logChannelId String?
|
|
automodEnabled Boolean?
|
|
automodConfig Json?
|
|
levelingEnabled Boolean?
|
|
ticketsEnabled Boolean?
|
|
musicEnabled Boolean?
|
|
statuspageEnabled Boolean?
|
|
statuspageConfig Json?
|
|
dynamicVoiceEnabled Boolean?
|
|
dynamicVoiceConfig Json?
|
|
supportLoginConfig Json?
|
|
birthdayEnabled Boolean?
|
|
birthdayConfig Json?
|
|
reactionRolesEnabled Boolean?
|
|
reactionRolesConfig Json?
|
|
eventsEnabled Boolean?\n registerEnabled Boolean?\n registerConfig Json?\n supportRoleId String?
|
|
updatedAt DateTime @updatedAt
|
|
createdAt DateTime @default(now())
|
|
}
|
|
|
|
model Ticket {
|
|
id String @id @default(cuid())
|
|
ticketNumber Int @default(autoincrement())
|
|
userId String
|
|
channelId String
|
|
guildId String
|
|
topic String?
|
|
priority String @default("normal")
|
|
status String @default("neu")
|
|
claimedBy String?
|
|
transcript String?
|
|
firstClaimAt DateTime?
|
|
firstResponseAt DateTime?
|
|
kbSuggestionSentAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model TicketAutomationRule {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
name String
|
|
condition Json
|
|
action Json
|
|
active Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([guildId, active])
|
|
}
|
|
|
|
model KnowledgeBaseArticle {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
title String
|
|
keywords String[]
|
|
content String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([guildId])
|
|
}
|
|
|
|
model Level {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
guildId String
|
|
xp Int @default(0)
|
|
level Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@unique([userId, guildId], name: "userId_guildId")
|
|
}
|
|
|
|
model TicketSupportSession {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
userId String
|
|
roleId String
|
|
startedAt DateTime @default(now())
|
|
endedAt DateTime?
|
|
durationSeconds Int?
|
|
|
|
@@index([guildId, userId, endedAt])
|
|
}
|
|
|
|
model Birthday {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
guildId String
|
|
birthDate String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@unique([userId, guildId], name: "birthday_user_guild")
|
|
@@index([guildId])
|
|
}
|
|
|
|
model ReactionRoleSet {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
channelId String
|
|
messageId String?
|
|
title String?
|
|
description String?
|
|
entries Json
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([guildId])
|
|
@@index([guildId, messageId])
|
|
}
|
|
|
|
model Event {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
title String
|
|
description String?
|
|
channelId String
|
|
startTime DateTime
|
|
repeatType String @default("none")
|
|
repeatConfig Json?
|
|
reminderOffsetMinutes Int @default(60)
|
|
roleId String?
|
|
isActive Boolean @default(true)
|
|
lastReminderAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
signups EventSignup[]
|
|
|
|
@@index([guildId])
|
|
@@index([guildId, startTime])
|
|
}
|
|
|
|
model EventSignup {
|
|
id String @id @default(cuid())
|
|
eventId String
|
|
guildId String
|
|
userId String
|
|
createdAt DateTime @default(now())
|
|
canceledAt DateTime?
|
|
|
|
event Event @relation(fields: [eventId], references: [id])
|
|
|
|
@@unique([eventId, userId])
|
|
@@index([guildId, eventId])
|
|
}
|
|
|
|
model RegisterForm {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
name String
|
|
description String?
|
|
reviewChannelId String?
|
|
notifyRoleIds String[]
|
|
isActive Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
fields RegisterFormField[]
|
|
applications RegisterApplication[]
|
|
|
|
@@index([guildId, isActive])
|
|
}
|
|
|
|
model RegisterFormField {
|
|
id String @id @default(cuid())
|
|
formId String
|
|
label String
|
|
type String
|
|
required Boolean @default(false)
|
|
sortOrder Int @default(0)
|
|
|
|
form RegisterForm @relation(fields: [formId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model RegisterApplication {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
userId String
|
|
formId String
|
|
status String @default("pending")
|
|
reviewedBy String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
answers RegisterApplicationAnswer[]
|
|
|
|
form RegisterForm @relation(fields: [formId], references: [id])
|
|
|
|
@@index([guildId, formId, status])
|
|
}
|
|
|
|
model RegisterApplicationAnswer {
|
|
id String @id @default(cuid())
|
|
applicationId String
|
|
fieldId String
|
|
value String
|
|
|
|
application RegisterApplication @relation(fields: [applicationId], references: [id], onDelete: Cascade)
|
|
}
|
|
|