Updated prisma schema for constraints

This commit is contained in:
lucast committed 2026-11-20 10:02:24 +01:00
1 parent a1c874c153
commit da72d777e2
6 files changed
+15 -5

No files matched your search

+4
View File
@@ -7,6 +7,8 @@ model SparePart {
supplierId Int
supplier Supplier @relation(fields: [supplierId], references: [id])
workOrderToSpareParts WorkOrderToSparePart[]
@@unique([supplierId, partNumber])
}
model Supplier {
@@ -22,7 +24,9 @@ model WorkOrderToSparePart {
workOrderId Int
workOrder WorkOrder @relation(fields: [workOrderId], references: [id])
// quantity > 0
quantity Int
// pricePerUnit >= 0
pricePerUnit Int
@@id([sparePartId, workOrderId])