Implement warning system enhancements with unique identifiers
- Added a `warningNumber` field to the `Warning` model for sequential identification of warnings. - Updated the `createWarning` function to handle the new `warningNumber` logic and notify users via DM upon receiving a warning. - Refactored moderation commands to utilize the new warning system, including changes to the warning creation and removal processes. - Enhanced the WebUI to display warning numbers in the warnings table and updated localization for related messages. - Documented changes in phase tracking to reflect the new warning system features.
This commit is contained in:
@@ -129,17 +129,19 @@ model Case {
|
||||
}
|
||||
|
||||
model Warning {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
userId String
|
||||
moderatorId String
|
||||
reason String?
|
||||
caseId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
case Case? @relation(fields: [caseId], references: [id], onDelete: SetNull)
|
||||
id String @id @default(cuid())
|
||||
warningNumber Int
|
||||
guildId String
|
||||
userId String
|
||||
moderatorId String
|
||||
reason String?
|
||||
caseId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
case Case? @relation(fields: [caseId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@unique([guildId, warningNumber])
|
||||
@@index([guildId, userId])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user