Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gtfs/trip.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Trip struct {
ShapeID tt.Key `target:"shapes.txt"`
WheelchairAccessible tt.Int `enum:"0,1,2"`
BikesAllowed tt.Int `enum:"0,1,2"`
CarsAllowed tt.Int `enum:"0,1,2"`
JourneyPatternID tt.String `csv:"-"`
JourneyPatternOffset tt.Int `csv:"-"`
StopPatternID tt.Int `csv:"-"`
Expand Down
63 changes: 63 additions & 0 deletions internal/generated/gqlout/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schema/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ type Trip {
wheelchair_accessible: Int
"GTFS trips.bikes_allowed"
bikes_allowed: Int
"GTFS trips.cars_allowed"
cars_allowed: Int
"Calculated stop pattern ID; an integer scoped to the feed version"
stop_pattern_id: Int!
"Calendar for this trip"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Add cars_allowed column to gtfs_trips table
ALTER TABLE public.gtfs_trips ADD COLUMN cars_allowed integer;
1 change: 1 addition & 0 deletions schema/sqlite/sqlite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ CREATE TABLE IF NOT EXISTS "gtfs_trips" (
"shape_id" int,
"wheelchair_accessible" integer,
"bikes_allowed" integer,
"cars_allowed" integer,
"stop_pattern_id" integer,
"id" integer primary key autoincrement,
"feed_version_id" integer NOT NULL,
Expand Down
4 changes: 2 additions & 2 deletions server/gql/trip_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ func TestTripResolver(t *testing.T) {
testcases := []testcase{
{
name: "basic fields",
query: `query($trip_id: String!) { trips(where:{trip_id:$trip_id}) {trip_id trip_headsign trip_short_name direction_id block_id wheelchair_accessible bikes_allowed stop_pattern_id }}`,
query: `query($trip_id: String!) { trips(where:{trip_id:$trip_id}) {trip_id trip_headsign trip_short_name direction_id block_id wheelchair_accessible bikes_allowed cars_allowed stop_pattern_id }}`,
vars: vars,
expect: `{"trips":[{"bikes_allowed":1,"block_id":null,"direction_id":1,"stop_pattern_id":21,"trip_headsign":"Antioch","trip_id":"3850526WKDY","trip_short_name":null,"wheelchair_accessible":1}]}`,
expect: `{"trips":[{"bikes_allowed":1,"block_id":null,"cars_allowed":null,"direction_id":1,"stop_pattern_id":21,"trip_headsign":"Antioch","trip_id":"3850526WKDY","trip_short_name":null,"wheelchair_accessible":1}]}`,
},
{
name: "calendar",
Expand Down
20 changes: 11 additions & 9 deletions testdata/gtfs-examples/bad-entities/trips.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
trip_id,route_id,service_id,trip_short_name,trip_headsign,direction_id,block_id,shape_id,wheelchair_accessible,bikes_allowed,expect_error
ok,ok,ok,valid,valid,0,0,ok,1,1,
,ok,ok,no trip_id,,,,,,,RequiredFieldError:trip_id
trip_id,route_id,service_id,trip_short_name,trip_headsign,direction_id,block_id,shape_id,wheelchair_accessible,bikes_allowed,cars_allowed,expect_error
ok,ok,ok,valid,valid,0,0,ok,1,1,1,
,ok,ok,no trip_id,,,,,,,,RequiredFieldError:trip_id
no_route_id,,ok,no route_id,,,,,,,RequiredFieldError:route_id
no_service_id,ok,,no service_id,,,,,,,RequiredFieldError:service_id
parse_direction_id,ok,ok,parse direction_id,,xyz,,,,,FieldParseError:direction_id
invalid_direction_id,ok,ok,invalid direction_id,,100,,,,,InvalidFieldError:direction_id
parse_wheelchair_accessible,ok,ok,parse wheelchair_accessible,,,,,xyz,,FieldParseError:wheelchair_accessible
invalid_wheelchair_access,ok,ok,invalid wheelchair_access,,,,,100,,InvalidFieldError:wheelchair_accessible
parse_bikes_allowed,ok,ok,parse bikes_allowed,,,,,,xyz,FieldParseError:bikes_allowed
invalid_bikes_allowed,ok,ok,invalid bikes_allowed,,,,,,100,InvalidFieldError:bikes_allowed
parse_direction_id,ok,ok,parse direction_id,,xyz,,,,,,FieldParseError:direction_id
invalid_direction_id,ok,ok,invalid direction_id,,100,,,,,,InvalidFieldError:direction_id
parse_wheelchair_accessible,ok,ok,parse wheelchair_accessible,,,,,xyz,,,FieldParseError:wheelchair_accessible
invalid_wheelchair_access,ok,ok,invalid wheelchair_access,,,,,100,,,InvalidFieldError:wheelchair_accessible
parse_bikes_allowed,ok,ok,parse bikes_allowed,,,,,,xyz,,FieldParseError:bikes_allowed
invalid_bikes_allowed,ok,ok,invalid bikes_allowed,,,,,,100,,InvalidFieldError:bikes_allowed
parse_cars_allowed,ok,ok,parse cars_allowed,,,,,,,xyz,FieldParseError:cars_allowed
invalid_cars_allowed,ok,ok,invalid cars_allowed,,,,,,,100,InvalidFieldError:cars_allowed
parse_arrival_time,ok,ok,for stop_times.txt
parse_departure_time,ok,ok,for stop_times.txt
parse_stop_sequence,ok,ok,for stop_times.txt
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func getVersion() VersionInfo {
}

// GTFSVERSION is the commit for the spec reference.md file.
var GTFSVERSION = "11a49075c1f50d0130b934833b7eeb3fe518961c"
var GTFSVERSION = "4f0166688c980ee30e6457035616bf96aa21d91f" // NOTE: some intervening changes have not yet been added

// GTFSRTVERSION is the commit for the gtfs-realtime.proto file.
var GTFSRTVERSION = "7b9f229dfa0b539c3fcf461986638890024feb06"
Loading