fix: db schema
This commit is contained in:
parent
873ff3d5ae
commit
5e35c23cfb
|
@ -8,17 +8,30 @@ generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
}
|
}
|
||||||
|
|
||||||
model Keys {
|
model Users {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
key String @unique
|
key String @unique
|
||||||
grades Grade[]
|
grades Grade[]
|
||||||
|
firstName String
|
||||||
|
lastName String
|
||||||
|
testOn DateTime? @db.Date
|
||||||
|
isTeacher Boolean @default(false)
|
||||||
|
test Test?
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
}
|
||||||
|
|
||||||
|
model Test {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
testOf Users @relation(fields: [testOfId], references: [id])
|
||||||
|
testOfId Int @unique
|
||||||
|
testOn DateTime @default(now())
|
||||||
|
createdAt DateTime @default(now())
|
||||||
}
|
}
|
||||||
|
|
||||||
model Grade {
|
model Grade {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
oral Int
|
user Users @relation(fields: [userId], references: [id])
|
||||||
grade Float
|
userId Int
|
||||||
key Keys @relation(fields: [keyId], references: [id])
|
note String
|
||||||
keyId Int
|
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue