Skip to content

Commit

Permalink
Apply default agency when importing
Browse files Browse the repository at this point in the history
  • Loading branch information
irees committed Oct 13, 2023
1 parent 721ba03 commit 9feaada
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dmfr/importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/interline-io/transitland-lib/dmfr"
"github.com/interline-io/transitland-lib/dmfr/store"
"github.com/interline-io/transitland-lib/ext/builders"
"github.com/interline-io/transitland-lib/filters"
"github.com/interline-io/transitland-lib/log"
"github.com/interline-io/transitland-lib/tl"
"github.com/interline-io/transitland-lib/tl/causes"
Expand Down Expand Up @@ -201,6 +202,11 @@ func ImportFeedVersion(atx tldb.Adapter, fv tl.FeedVersion, opts Options) (dmfr.
if err != nil {
return fvi, err
}

// Avoid foreign key errors when writing to database
cp.AddExtension(&filters.ApplyDefaultAgencyFilter{})

// Builder extensions
cp.AddExtension(builders.NewRouteGeometryBuilder())
cp.AddExtension(builders.NewRouteStopBuilder())
cp.AddExtension(builders.NewRouteHeadwayBuilder())
Expand Down

0 comments on commit 9feaada

Please sign in to comment.