Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only raise a foreign key violation error when network_id is missing from both networks.txt and routes.txt #1764

Open
qcdyx opened this issue May 17, 2024 · 1 comment · May be fixed by #1766
Labels
enhancement New feature request or improvement on an existing feature status: Needs triage Applied to all new issues

Comments

@qcdyx
Copy link
Contributor

qcdyx commented May 17, 2024

Describe the problem

The network_id field of GtfsFareLegRule is a foreign key that references routes.txt. If should reference both routes.txt and networks.txt. cc @tzujenchanmbd

Proposed solution

networkId is declared as a foreign key that references the network_id field in both the routes.txt and networks.txt tables.

Logic:

IF network_id exists in fare_leg_rules.txt but not in routes.txt OR networks.txt, generate a foreign_key_violation notice.

Alternatives you've considered

No response

Additional context

No response

@qcdyx qcdyx added enhancement New feature request or improvement on an existing feature status: Needs triage Applied to all new issues labels May 17, 2024
@qcdyx qcdyx self-assigned this May 17, 2024
@qcdyx qcdyx linked a pull request May 21, 2024 that will close this issue
5 tasks
@emmambd
Copy link
Contributor

emmambd commented May 30, 2024

Answers to some questions @davidgamez @qcdyx shared on this issue:

Based on this, do you need anything else clarified before I rewrite the issue to specify 1. we need to change foreign_key_violation to omit network_id 2. we need to add a new rule to check this conditional?

@emmambd emmambd added this to the 6.0 Validator Release milestone May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request or improvement on an existing feature status: Needs triage Applied to all new issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants