Add events module with dashboard UI, scheduling, signups, and settings updates; extend env/readme.
This commit is contained in:
134
prisma/schema.prisma
Normal file
134
prisma/schema.prisma
Normal file
@@ -0,0 +1,134 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
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?
|
||||
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
|
||||
claimedBy String?
|
||||
transcript String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
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])
|
||||
}
|
||||
Reference in New Issue
Block a user