intermediate stops

This commit is contained in:
2026-06-13 17:02:58 +02:00
parent 5eaef4612d
commit 14cd49a8dd
7 changed files with 181 additions and 1 deletions

View File

@@ -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])
}