DEV Community

Kanishka
Kanishka

Posted on

Prisma, gtfs-schedule - rough, incomplete Trip models

model Trip {
  tripId String @id
  tripHeadsign String
  directionId Int
  stopTimes StopTime[]
}

model Stop {
  stopId String @id
  stopCode String?
  stopName String?
  stopLat Float?
  stopLon Float?
  locationType LocationType

  stopTimes StopTime[]
}

model StopTime {
  arrivalTime DateTime // TODO: time
  stopSequence Int

  stop Stop @relation(fields: [stopId], references: [stopId])
  stopId String
  trip Trip @relation(fields: [tripId], references: [tripId])
  tripId String

  @@id(stopId, tripId)
}

enum LocationType {
  BUSSTOP
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)