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) permission_roles PermissionRole[] 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 PermissionRole { id Int @id @default(autoincrement()) name String guild_id String roles String[] @default([]) users String[] @default([]) grantedPermissions String[] @default([]) level Int? createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt snippet Snippet? @relation(fields: [snippetId], references: [id]) snippetId Int? @@map("permission_roles") } 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? 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([]) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt @@map("afk_entries") } enum PermissionLogicMode { OR AND } model CommandPermissionOverwrites { 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") }