30 lines
703 B
Plaintext
30 lines
703 B
Plaintext
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])
|
|
}
|