Enhance environment configuration and expand Prisma schema for bot management
- Added OWNER_USER_IDS to .env.example for specifying global bot owners. - Introduced new models in the Prisma schema: CommandOverride, OwnerTeamMember, GlobalUserBlacklist, GuildBlacklist, FeatureFlag, BotPresenceConfig, ChangelogEntry, and OwnerAuditLog to support advanced bot management features. - Updated env.ts to preprocess OWNER_USER_IDS for better handling of global bot owner IDs. - Modified ModulePlaceholderPage to ensure proper routing for remaining dashboard modules.
This commit is contained in:
@@ -53,6 +53,7 @@ model Guild {
|
||||
guildBackups GuildBackup[]
|
||||
dashboardAccessRules DashboardAccessRule[]
|
||||
dashboardAuditLogs DashboardAuditLog[]
|
||||
commandOverrides CommandOverride[]
|
||||
}
|
||||
|
||||
model GuildSettings {
|
||||
@@ -790,3 +791,93 @@ model GuildBackup {
|
||||
@@index([guildId, createdAt])
|
||||
}
|
||||
|
||||
model CommandOverride {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
commandName String
|
||||
enabled Boolean @default(true)
|
||||
allowedRoleIds String[] @default([])
|
||||
deniedRoleIds String[] @default([])
|
||||
allowedChannelIds String[] @default([])
|
||||
deniedChannelIds String[] @default([])
|
||||
cooldownSeconds Int?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([guildId, commandName])
|
||||
@@index([guildId])
|
||||
}
|
||||
|
||||
model OwnerTeamMember {
|
||||
id String @id @default(cuid())
|
||||
userId String @unique
|
||||
role String
|
||||
note String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model GlobalUserBlacklist {
|
||||
id String @id @default(cuid())
|
||||
userId String @unique
|
||||
reason String?
|
||||
note String?
|
||||
createdById String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model GuildBlacklist {
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
reason String?
|
||||
createdById String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model FeatureFlag {
|
||||
id String @id @default(cuid())
|
||||
key String @unique
|
||||
enabled Boolean @default(false)
|
||||
rolloutPercent Int @default(0)
|
||||
whitelistGuildIds String[] @default([])
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model BotPresenceConfig {
|
||||
id String @id @default("singleton")
|
||||
status String @default("online")
|
||||
activityType String @default("Playing")
|
||||
activityText String @default("nexumi.de")
|
||||
rotatingMessages Json?
|
||||
maintenanceMode Boolean @default(false)
|
||||
maintenanceMessage String?
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ChangelogEntry {
|
||||
id String @id @default(cuid())
|
||||
version String
|
||||
title String
|
||||
body String
|
||||
publishedAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model OwnerAuditLog {
|
||||
id String @id @default(cuid())
|
||||
actorUserId String
|
||||
action String
|
||||
targetType String?
|
||||
targetId String?
|
||||
before Json?
|
||||
after Json?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user