Merge branch 'master' of 192.168.11.4:thowitz-work/tremor-tracker
This commit is contained in:
commit
fbbc0a4cdb
@ -17,7 +17,7 @@ model User {
|
||||
passwordHash String
|
||||
role String @default("GUEST") @db.VarChar(10) // Allowed: ADMIN, SCIENTIST, GUEST
|
||||
scientist Scientist? @relation
|
||||
purchasedArtefacts Artefact[] @relation("UserPurchasedArtefacts")
|
||||
purchasedOrders Order[] @relation("UserOrders")
|
||||
requests Request[] @relation("UserRequests")
|
||||
}
|
||||
|
||||
@ -97,10 +97,8 @@ model Artefact {
|
||||
dateAddedToShop DateTime?
|
||||
shopPrice Float?
|
||||
isSold Boolean @default(false)
|
||||
purchasedById Int?
|
||||
purchasedBy User? @relation("UserPurchasedArtefacts", fields: [purchasedById], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
// todo unlink purchase from user
|
||||
// todo link purchase to order
|
||||
orderId Int?
|
||||
order Order? @relation("OrderArtefacts", fields: [orderId], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
isCollected Boolean @default(false)
|
||||
}
|
||||
|
||||
@ -117,5 +115,7 @@ model Order {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
orderNumber String
|
||||
// todo link order to user
|
||||
userId Int
|
||||
user User @relation("UserOrders", fields: [userId], references: [id])
|
||||
artefacts Artefact[] @relation("OrderArtefacts")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user