256 lines
6.3 KiB
Text
256 lines
6.3 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"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
//
|
|
|
|
model Guild {
|
|
id String @unique
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
GuildConfigEmbeds GuildConfigEmbeds?
|
|
GuildConfigCredits GuildConfigCredits?
|
|
GuildConfigPoints GuildConfigPoints?
|
|
GuildConfigReputation GuildConfigReputation?
|
|
GuildConfigCounters GuildConfigCounters?
|
|
GuildConfigApisCpgg GuildConfigApisCpgg?
|
|
GuildConfigAudits GuildConfigAudits?
|
|
GuildConfigShop GuildConfigShop?
|
|
GuildConfigShopRoles GuildConfigShopRoles?
|
|
GuildConfigWelcome GuildConfigWelcome?
|
|
GuildShopRoles GuildShopRoles[]
|
|
GuildMember GuildMember[]
|
|
Cooldown Cooldown[]
|
|
GuildCounters GuildCounters[]
|
|
}
|
|
|
|
model User {
|
|
id String @unique
|
|
GuildMember GuildMember[]
|
|
|
|
// Settings
|
|
|
|
// Modules
|
|
reputationsEarned Int @default(0)
|
|
Cooldown Cooldown[]
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
GuildShopRoles GuildShopRoles[]
|
|
}
|
|
|
|
model GuildMember {
|
|
userId String
|
|
guildId String
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
guild Guild @relation(fields: [guildId], references: [id])
|
|
|
|
// Settings
|
|
|
|
pointsEarned Int @default(0)
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
GuildShopRoles GuildShopRoles[]
|
|
GuildMemberCredit GuildMemberCredit?
|
|
|
|
// Unique Identifier
|
|
@@unique([userId, guildId])
|
|
}
|
|
|
|
//
|
|
|
|
model GuildConfigEmbeds {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
successColor String @default("#22bb33")
|
|
waitColor String @default("#f0ad4e")
|
|
errorColor String @default("#bb2124")
|
|
footerText String @default("https://github.com/ZynerOrg/xyter")
|
|
footerIcon String @default("https://github.com/ZynerOrg.png")
|
|
}
|
|
|
|
model GuildConfigCredits {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
rate Int @default(1)
|
|
timeout Int @default(5)
|
|
workRate Int @default(25)
|
|
workTimeout Int @default(86400)
|
|
minimumLength Int @default(5)
|
|
}
|
|
|
|
model GuildConfigPoints {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
rate Int @default(1)
|
|
timeout Int @default(5)
|
|
minimumLength Int @default(5)
|
|
}
|
|
|
|
model GuildConfigReputation {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
}
|
|
|
|
model GuildConfigCounters {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
}
|
|
|
|
model GuildConfigApisCpgg {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
urlIv String?
|
|
urlContent String?
|
|
tokenIv String?
|
|
tokenContent String?
|
|
}
|
|
|
|
model GuildConfigAudits {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
channelId String
|
|
}
|
|
|
|
model GuildConfigShop {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
roles GuildConfigShopRoles? @relation(fields: [guildConfigShopRolesId], references: [id])
|
|
guildConfigShopRolesId String?
|
|
}
|
|
|
|
model GuildConfigShopRoles {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
pricePerHour Int @default(5)
|
|
GuildConfigShop GuildConfigShop[]
|
|
}
|
|
|
|
model GuildConfigWelcome {
|
|
id String @unique
|
|
guild Guild @relation(fields: [id], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status Boolean @default(false)
|
|
joinChannelId String?
|
|
joinChannelMessage String?
|
|
leaveChannelId String?
|
|
leaveChannelMessage String?
|
|
}
|
|
|
|
///////////////////////////////////////
|
|
///////////////////////////////////////
|
|
///////////////////////////////////////
|
|
///////////////////////////////////////
|
|
///////////////////////////////////////
|
|
|
|
model GuildCounters {
|
|
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 GuildMemberCredit {
|
|
userId String
|
|
guildId String
|
|
|
|
GuildMember GuildMember @relation(fields: [userId, guildId], references: [userId, guildId])
|
|
|
|
balance Int @default(0)
|
|
|
|
@@unique([userId, guildId])
|
|
}
|
|
|
|
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])
|
|
}
|
|
|
|
model GuildShopRoles {
|
|
guildId String
|
|
roleId String
|
|
userId String
|
|
pricePerHour Int @default(5)
|
|
lastPayed DateTime
|
|
|
|
guild Guild @relation(fields: [guildId], references: [id])
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
member GuildMember? @relation(fields: [userId, guildId], references: [userId, guildId])
|
|
|
|
@@unique([guildId, userId, roleId])
|
|
}
|