intermediate stops
This commit is contained in:
@@ -21,6 +21,7 @@ model Location {
|
||||
// A location can be the start OR end of many cables
|
||||
startCables Cable[] @relation("StartLocation")
|
||||
endCables Cable[] @relation("EndLocation")
|
||||
cableStops CableStop[]
|
||||
}
|
||||
|
||||
// A single cable run documented in the system
|
||||
@@ -39,6 +40,7 @@ model Cable {
|
||||
endLocation Location @relation("EndLocation", fields: [endLocationId], references: [id])
|
||||
|
||||
cores Core[] // One cable can have many cores/wires
|
||||
intermediateStops CableStop[]
|
||||
}
|
||||
|
||||
// A single wire/core within a cable (e.g., "Blau", "Rot/Weiß")
|
||||
@@ -49,4 +51,15 @@ model Core {
|
||||
|
||||
cableId Int
|
||||
cable Cable @relation(fields: [cableId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model CableStop {
|
||||
id Int @id @default(autoincrement())
|
||||
order Int
|
||||
cable Cable @relation(fields: [cableId], references: [id], onDelete: Cascade)
|
||||
cableId Int
|
||||
location Location @relation(fields: [locationId], references: [id])
|
||||
locationId Int
|
||||
|
||||
@@unique([cableId, order])
|
||||
}
|
||||
Reference in New Issue
Block a user