generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DB_URL") } enum InfractionType { BAN KICK MUTE WARNING MASSBAN MASSKICK UNBAN UNMUTE BULK_DELETE_MESSAGE TIMEOUT TIMEOUT_REMOVE BEAN NOTE ROLE MOD_MESSAGE SHOT } enum InfractionDeliveryStatus { SUCCESS FALLBACK FAILED NOT_DELIVERED } model Infraction { id Int @id @default(autoincrement()) type InfractionType userId String guildId String reason String? moderatorId String expiresAt DateTime? metadata Json? deliveryStatus InfractionDeliveryStatus @default(SUCCESS) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt queueId Int? @@map("infractions") } model PermissionOverwrite { id Int @id @default(autoincrement()) name String? guildId String roles String[] @default([]) users String[] @default([]) grantedDiscordPermissions String[] @default([]) grantedSystemPermissions String[] @default([]) priority Int @default(0) merge Boolean @default(true) disabled Boolean @default(false) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("permission_overwrites") } model PermissionLevel { id Int @id @default(autoincrement()) guildId String level Int disabled Boolean @default(false) grantedDiscordPermissions String[] @default([]) grantedSystemPermissions String[] @default([]) roles String[] @default([]) users String[] @default([]) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("permission_levels") } enum CommandPermissionOverwriteAction { ALLOW DENY } model CommandPermissionOverwrite { id Int @id @default(autoincrement()) guildId String commands String[] requiredDiscordPermissions Json @default("null") requiredSystemPermissions Json @default("null") requiredRoles Json @default("null") requiredUsers Json @default("null") requiredChannels Json @default("null") requiredLevel Int? disabled Boolean @default(false) onMatch CommandPermissionOverwriteAction @default(ALLOW) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("command_permission_overwrites") } model Queue { id Int @id @default(autoincrement()) userId String guildId String channelId String? messageId String? name String repeat Boolean @default(false) data Json @default("{}") createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt runsAt DateTime? @@map("queues") } model MuteRecord { id Int @id @default(autoincrement()) memberId String guildId String roles String[] createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("mute_records") } model ChannelLock { id Int @id @default(autoincrement()) guildId String channelId String permissions Json createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("channel_locks") } model AfkEntry { id Int @id @default(autoincrement()) reason String? userId String guildId String mentions String[] @default([]) mentionCount Int @default(0) global Boolean @default(false) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("afk_entries") } model User { id Int @id @default(autoincrement()) name String? username String discordId String githubId 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 Snippet { id Int @id @default(autoincrement()) name String userId String guildId String aliases String[] @default([]) 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 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") } enum PermissionLogicMode { OR AND } model VerificationEntry { id Int @id @default(autoincrement()) userId String guildId String code String @unique attempts Int @default(0) metadata Json? expiresAt DateTime createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@unique([userId, guildId]) @@map("verification_entries") } model VerificationRecord { id Int @id @default(autoincrement()) guildId String userId String discordId String? githubId String? googleId String? email String? method VerificationMethod createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("verification_records") } enum VerificationMethod { DISCORD GITHUB GOOGLE EMAIL }