Skip to content

Commit

Permalink
improvement(Table.java): Reinstated key field is not unique check for…
Browse files Browse the repository at this point in the history
… the route network table

The route id is unique to the route table has well. This prevents duplicate key failures
  • Loading branch information
br648 committed Feb 6, 2025
1 parent 2c256c9 commit 518fcc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/conveyal/gtfs/loader/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ public Table (String name, Class<? extends Entity> entityClass, Requirement requ
new StringField(RouteNetwork.ROUTE_ID_NAME, REQUIRED).isReferenceTo(ROUTES),
new StringField(RouteNetwork.NETWORK_ID_NAME, REQUIRED).isReferenceTo(NETWORKS)
)
// Although within the context of this table the route id is unique, the unique value e.g. route_id:1 has already
// been flagged as unique when the route table is loaded!
.keyFieldIsNotUnique()
.addPrimaryKeyNames(RouteNetwork.ROUTE_ID_NAME);

// GTFS reference: https://developers.google.com/transit/gtfs/reference#fare_rulestxt
Expand Down

0 comments on commit 518fcc2

Please sign in to comment.