mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 06:34:15 +00:00
feat: reimplement punishments
This commit is contained in:
parent
7bd84ea454
commit
77828653ba
34 changed files with 1229 additions and 1068 deletions
|
|
@ -90,12 +90,9 @@ model Mii {
|
|||
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
likeCount Int @default(0)
|
||||
|
||||
punishmentId Int?
|
||||
punishments MiiPunishment[]
|
||||
likedBy Like[]
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
likeCount Int @default(0)
|
||||
likedBy Like[]
|
||||
|
||||
@@index([tags], type: Gin)
|
||||
@@index([createdAt])
|
||||
|
|
@ -142,28 +139,13 @@ model Report {
|
|||
@@map("reports")
|
||||
}
|
||||
|
||||
model MiiPunishment {
|
||||
punishmentId Int
|
||||
miiId Int
|
||||
reason String
|
||||
|
||||
punishment Punishment @relation(fields: [punishmentId], references: [id], onDelete: Cascade)
|
||||
mii Mii @relation(fields: [miiId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([punishmentId, miiId])
|
||||
@@map("mii_punishments")
|
||||
}
|
||||
|
||||
model Punishment {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
type PunishmentType
|
||||
returned Boolean @default(false)
|
||||
|
||||
notes String
|
||||
reasons String[]
|
||||
violatingMiis MiiPunishment[]
|
||||
|
||||
reason String
|
||||
expiresAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue