Added basic prisma schema
This commit is contained in:
9 files changed
+140
-9
No files matched your search
@@ -0,0 +1,29 @@
|
||||
model SparePart {
|
||||
id Int @id @default(autoincrement())
|
||||
|
||||
name String
|
||||
partNumber String
|
||||
|
||||
supplierId Int
|
||||
supplier Supplier @relation(fields: [supplierId], references: [id])
|
||||
workOrderToSpareParts WorkOrderToSparePart[]
|
||||
}
|
||||
|
||||
model Supplier {
|
||||
id Int @id @default(autoincrement())
|
||||
|
||||
name String
|
||||
spareParts SparePart[]
|
||||
}
|
||||
|
||||
model WorkOrderToSparePart {
|
||||
sparePartId Int
|
||||
sparePart SparePart @relation(fields: [sparePartId], references: [id])
|
||||
workOrderId Int
|
||||
workOrder WorkOrder @relation(fields: [workOrderId], references: [id])
|
||||
|
||||
quantity Int
|
||||
pricePerUnit Int
|
||||
|
||||
@@id([sparePartId, workOrderId])
|
||||
}
|
||||
Reference in new issue
Block a user