Added basic prisma schema

This commit is contained in:
lucast committed 2026-11-20 09:46:10 +01:00
1 parent df5a977608
commit a1c874c153
9 files changed
+140 -9

No files matched your search

+29
View File
@@ -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])
}