Prisma, gtfs-schedule - rough, incomplete Trip models

codewander

Kanishka

Posted on November 25, 2024

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
💖 💪 🙅 🚩
codewander
Kanishka

Posted on November 25, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related