class implementation with fixes and prisma schema changes

This commit is contained in:
Stanislaw
2022-04-29 00:43:24 +02:00
parent f308503816
commit a2c8e1cfee
4 changed files with 124 additions and 110 deletions

View File

@@ -8,30 +8,29 @@ datasource db {
}
model badges {
badge_id Int @id
badge_id Int @id
badge_name String
badge_description String
badge_type Int @default(0)
given_badges given_badges[] @ignore
badge_type Int @default(0)
givenbadges givenbadges[]
}
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by the Prisma Client.
model given_badges {
user_id String
badge_id Int
badges badges @relation(fields: [badge_id], references: [badge_id], onDelete: NoAction, onUpdate: NoAction, map: "badge_id")
users users @relation(fields: [user_id], references: [user_id], onDelete: NoAction, onUpdate: NoAction, map: "user_id")
model givenbadges {
user_id String
badge_id Int
date_of_confer DateTime @id @db.Date
badges badges @relation(fields: [badge_id], references: [badge_id], onDelete: NoAction, onUpdate: NoAction, map: "badge_id")
users users @relation(fields: [user_id], references: [user_id], onDelete: NoAction, onUpdate: NoAction, map: "user_id")
@@index([badge_id], map: "fki_badge_id")
@@index([user_id], map: "fki_user_id")
@@ignore
}
model users {
user_id String @id(map: "user_pkey")
exp Int @default(0)
msg_count Int @default(0)
voice_time Int @default(0)
lvl Int @default(0)
given_badges given_badges[] @ignore
user_id String @id(map: "user_pkey")
exp Int @default(0)
msg_count Int @default(0)
voice_time Int @default(0)
lvl Int @default(0)
givenbadges givenbadges[]
}