feat(database): add restrict, ban, tempban and more roles

This commit is contained in:
Anthony 2022-07-11 01:07:56 +01:00
parent 7a872b0f1a
commit 5fd19e8909
2 changed files with 45 additions and 3 deletions

3
.gitignore vendored
View File

@ -105,3 +105,6 @@ dist
# IntelliJ IDEA
/.idea/
# Prisma migration files
/prisma/migrations/

View File

@ -10,7 +10,46 @@ datasource db {
url = env("DATABASE_URL")
}
model user {
id Int @id
vegan Boolean @default(false)
model User {
id String @id @db.VarChar(255)
level Int @default(0)
xp Int @default(0)
balance Int @default(0)
lastDaily DateTime
vegan Boolean @default(false)
activist Boolean @default(false)
trusted Boolean @default(false)
plus Boolean @default(false)
muted Boolean @default(false)
Restrict Restrict[]
Ban Ban[]
TempBan TempBan[]
}
model Restrict {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String
startTime DateTime @default(now())
endedTime DateTime?
reason String
}
model Ban {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String
time DateTime @default(now())
active Boolean @default(true)
reason String
}
model TempBan {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String
startTime DateTime @default(now())
endedTime DateTime
active Boolean @default(true)
reason String
}