112 lines
2.7 KiB
Text
112 lines
2.7 KiB
Text
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
previewFeatures = ["interactiveTransactions"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Guild {
|
|
id String @unique
|
|
guildMembers GuildMember[]
|
|
cooldowns Cooldown[]
|
|
|
|
// Settings
|
|
embedColorSuccess String @default("#22bb33")
|
|
embedColorWait String @default("#f0ad4e")
|
|
embedColorError String @default("#bb2124")
|
|
embedFooterText String @default("https://github.com/ZynerOrg/xyter")
|
|
embedFooterIcon String @default("https://github.com/ZynerOrg.png")
|
|
|
|
apiCpggUrlIv String?
|
|
apiCpggUrlContent String?
|
|
apiCpggTokenIv String?
|
|
apiCpggTokenContent String?
|
|
|
|
// Modules
|
|
creditsEnabled Boolean @default(false)
|
|
creditsRate Int @default(1)
|
|
creditsTimeout Int @default(5)
|
|
creditsWorkRate Int @default(25)
|
|
creditsWorkTimeout Int @default(86400)
|
|
creditsMinimumLength Int @default(5)
|
|
|
|
pointsEnabled Boolean @default(false)
|
|
pointsRate Int @default(1)
|
|
pointsTimeout Int @default(5)
|
|
pointsMinimumLength Int @default(5)
|
|
|
|
reputationsEnabled Boolean @default(false)
|
|
|
|
countersEnabled Boolean @default(false)
|
|
counters GuildCounter[]
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model User {
|
|
id String @unique
|
|
GuildMember GuildMember[]
|
|
|
|
// Settings
|
|
|
|
// Modules
|
|
reputationsEarned Int @default(0)
|
|
Cooldown Cooldown[]
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model GuildMember {
|
|
userId String
|
|
guildId String
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
guild Guild @relation(fields: [guildId], references: [id])
|
|
|
|
// Settings
|
|
|
|
// Modules
|
|
creditsEarned Int @default(0)
|
|
pointsEarned Int @default(0)
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
// Unique Identifier
|
|
@@unique([userId, guildId])
|
|
}
|
|
|
|
model GuildCounter {
|
|
guildId String
|
|
channelId String
|
|
triggerWord String
|
|
count Int @default(0)
|
|
guild Guild @relation(fields: [guildId], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@unique([guildId, channelId])
|
|
}
|
|
|
|
model Cooldown {
|
|
guild Guild @relation(fields: [guildId], references: [id])
|
|
user User @relation(fields: [userId], references: [id])
|
|
guildId String
|
|
userId String
|
|
cooldown Int
|
|
timeoutId String
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@unique([guildId, userId, timeoutId])
|
|
}
|