openbeta-graphql icon indicating copy to clipboard operation
openbeta-graphql copied to clipboard

Check for duplicate short codes

Open vnugent opened this issue 3 years ago • 1 comments

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
Screen Shot 2022-11-03 at 8 00 23 PM

vnugent avatar Nov 04 '22 03:11 vnugent

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 🤗

CocoisBuggy avatar Feb 27 '23 17:02 CocoisBuggy