openbeta-graphql
openbeta-graphql copied to clipboard
Check for duplicate short codes
We should enforce "airport-code" shortCode uniqueness within a country.
For example, there should only 1 CRACKS in the US.
Implementation ideas:
- [ ] add a new country code field to metadata. See addCountry()
- [ ] create a compound index with
metadata.shortCode+metadata.countryCode
I can work on this, but I have an architectural query:
Do shortcodes need to be globally unique, or do they need to be unique per root area \ parent area.
I can enforce the database rule easily enough, but would like to be sure I know how this system is meant to work 🤗