Skip to content

Some Primary Key may by empty #605

@nchazot

Description

@nchazot

Describe the problem

I have made a quick revue of PK constraints, I have found some "easter egg" 🤗
5 PK cases :

cases table PK Presence
1 agency agency_id Conditionally Required
2 fare_leg_rules network_id, from_area_id, to_area_id, from_timeframe_group_id, to_timeframe_group_id, fare_product_id only fare_product_id is required, attemps PK may equal to fare_product_id
3 fare_transfert_rules from_leg_group_id, to_leg_group_id, fare_product_id, transfer_count, duration_limit only fare_product_id is required, attemps PK may equal to fare_product_id
4 transfers from_stop_id, to_stop_id, from_trip_id, to_trip_id, from_route_id, to_route_id none of thoses fileds are required into the table, may have an empty PK
5 attributions attributions_id Optional

So I think an empty PK is not practical (cases 1,4,5)
And a composite primary key equal to the real PK into source table (fare_product_id) bothers me (cases 2,3)

Use cases

see above

Proposed solution

solution ?

Cases table PK Presence proposal
1 agency agency_id Required
2 fare_leg_rules fare_leg_rule_id auto increment
3 fare_transfert_rules fare_transfert_rule_id auto increment
4 transfers transfer_id auto increment
5 attributions attributions_id Required

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Change type: FunctionalRefers to modifications that significantly affect specification functionalities.GTFS-FaresIssues and Pull Requests that focus on GTFS-Fares Extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions