generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DB_URL") } enum InfractionType { BAN KICK MUTE WARNING MASSBAN TEMPBAN SOFTBAN MASSKICK UNBAN UNMUTE BULK_DELETE_MESSAGE TIMEOUT TIMEOUT_REMOVE BEAN NOTE } model Infraction { id Int @id @default(autoincrement()) type InfractionType userId String guildId String reason String? moderatorId String expiresAt DateTime? metadata Json? createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt queueId Int? @@map("infractions") } model SpamRecord { id Int @id @default(autoincrement()) user_id String guild_id String level Int @default(1) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("spam_records") } model Queue { id Int @id @default(autoincrement()) user_id String guild_id String channel_id String? message_id String? file_name String name String args String[] @default([]) createdAt DateTime @default(now()) willRunAt DateTime @@map("queues") } model Snippet { id Int @id @default(autoincrement()) name String user_id String guild_id String roles String[] @default([]) channels String[] @default([]) users String[] @default([]) attachments String[] @default([]) content String[] @default([]) randomize Boolean @default(false) permissions String[] @default([]) permissionMode PermissionLogicMode @default(AND) level Int? createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("snippets") } model ChannelLock { id Int @id @default(autoincrement()) guild_id String channel_id String permissions Json createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("channel_locks") } model PermissionOverwrite { id Int @id @default(autoincrement()) name String? guildId String roles String[] @default([]) users String[] @default([]) grantedPermissions String[] @default([]) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("permission_overwrites") } model ReactionRole { id Int @id @default(autoincrement()) emoji String isBuiltInEmoji Boolean guildId String channelId String messageId String roles String[] requiredRoles String[] @default([]) blacklistedUsers String[] @default([]) requiredPermissions String[] @default([]) level Int? single Boolean @default(false) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("reaction_roles") } model User { id Int @id @default(autoincrement()) name String? username String discordId String guilds String[] @default([]) password String token String? recoveryToken String? recoveryCode String? recoveryAttempts Int @default(0) recoveryTokenExpiresAt DateTime? createdAt DateTime @default(now()) tokenExpiresAt DateTime? updatedAt DateTime @default(now()) @updatedAt @@map("users") } model BoostRoleEntries { id Int @id @default(autoincrement()) role_id String user_id String guild_id String createdAt DateTime @default(now()) @@map("boost_role_entries") } model AfkEntry { id Int @id @default(autoincrement()) reason String? userId String guildId String mentions String[] @default([]) global Boolean @default(false) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("afk_entries") } enum PermissionLogicMode { OR AND } model CommandPermissionOverwrite { id Int @id @default(autoincrement()) guildId String commands String[] requiredPermissions String[] @default([]) requiredPermissionMode PermissionLogicMode @default(AND) mode PermissionLogicMode @default(AND) requiredRoles String[] @default([]) requiredUsers String[] @default([]) requiredChannels String[] @default([]) requiredLevel Int? createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("command_permission_overwrites") } model Ballot { id Int @id @default(autoincrement()) guildId String channelId String messageId String userId String content String anonymous Boolean @default(false) files String[] @default([]) upvotes String[] @default([]) downvotes String[] @default([]) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("ballots") } model PermissionLevel { id Int @id @default(autoincrement()) guildId String level Int disabled Boolean @default(false) grantedPermissions String[] @default([]) roles String[] @default([]) users String[] @default([]) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("permission_levels") } model Review { id Int @id @default(autoincrement()) reviewer String? content String rating Int discordId String? email String? aboutReviewer String? approved Boolean @default(false) ip String? createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("reviews") } model VerificationEntry { id Int @id @default(autoincrement()) userId String token String @unique guildId String attempts Int @default(0) meta Json? createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("verification_entries") } model GlobalUserBan { id Int @id @default(autoincrement()) userId String @unique reason String? executorId String notified Boolean @default(false) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("global_user_bans") } model UserStatistics { id Int @id @default(autoincrement()) userId String guildId String messagesSent Int @default(0) messagesEdited Int @default(0) messagesDeleted Int @default(0) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("user_statistics") }