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

Move countries to locations table #4744

Merged
merged 2 commits into from
May 16, 2024
Merged

Conversation

gjvoosten
Copy link
Collaborator

@gjvoosten gjvoosten commented Apr 23, 2024

  • Adds a new location type for countries and inserts countries from STANAG 1059 in the locations table; sets a few old ones to 'inactive'.
  • Replaces people.country with a foreign key reference to locations.uuid.
  • Migrates existing countries, using exact matches and some heuristics; keeping the old country names if we don't have an exact match, to give users the opportunity to correct this themselves.

Closes AB#1083

User changes

  • Users can pick their nationality from the list of available countries.

Superuser changes

  • None.

Admin changes

  • Admins can maintain the list of countries via the locations of type Country.
  • You can search for people with nationality "Unknown" to check for countries that couldn't be migrated automatically.

System admin changes

  • anet.yml or anet-dictionary.yml needs change
    Add:
    fields:
      location:
        […]
        digram:
          label: Digram
          placeholder: Fill in the 2-letter code for this country
        trigram:
          label: Trigram
          placeholder: Fill in the 3-letter code for this country
        […]
    
    and remove the setting fields.person.regular.countries.
  • db needs migration
  • documentation has changed
  • graphql schema has changed

Checklist

  • Described the user behavior in PR body
  • Referenced/updated all related issues
  • commits follow a repo#issue: Title title format and these 7 rules
  • commits have a clean history, otherwise PR may be squash-merged
  • Added and/or updated unit tests
  • Added and/or updated e2e tests
  • Added and/or updated data migrations
  • Updated documentation
  • Resolved all build errors and warnings
  • Opened debt issues for anything not resolved here

@gjvoosten gjvoosten force-pushed the AB-1083-move-countries-to-locations branch from aa45e3a to 2b8f0f1 Compare April 23, 2024 14:23
@gjvoosten gjvoosten marked this pull request as ready for review April 23, 2024 14:59
@gjvoosten gjvoosten requested a review from midmarch April 23, 2024 14:59
@gjvoosten gjvoosten force-pushed the AB-1083-move-countries-to-locations branch 2 times, most recently from f08d3c5 to 61ff9ef Compare April 24, 2024 07:36
@gjvoosten gjvoosten force-pushed the AB-1083-move-countries-to-locations branch 2 times, most recently from c6aa67e to 98dbe29 Compare April 30, 2024 14:02
@gjvoosten gjvoosten force-pushed the AB-1083-move-countries-to-locations branch 3 times, most recently from 61a3e84 to eb5f963 Compare May 7, 2024 12:00
@gjvoosten gjvoosten force-pushed the AB-1083-move-countries-to-locations branch 2 times, most recently from b7b2a88 to 539e2cb Compare May 13, 2024 09:06
- Add a new location type for countries and insert countries from STANAG
  1059 in the locations table; set a few old ones to 'inactive'.
- Replace people.country with a foreign key reference to locations.uuid.
- Migrate existing countries, using exact matches and some heuristics;
  keeping the old country names if we don't have an exact match, to give
  users the opportunity to correct this themselves.
@gjvoosten gjvoosten force-pushed the AB-1083-move-countries-to-locations branch from 539e2cb to 488ac45 Compare May 15, 2024 13:18
Copy link
Contributor

@midmarch midmarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

src/main/resources/anet-schema.yml Show resolved Hide resolved
anet-dictionary.yml Outdated Show resolved Hide resolved
Also change the labels for the digram/trigram fields.
@gjvoosten gjvoosten requested a review from midmarch May 15, 2024 14:30
Copy link
Contributor

@midmarch midmarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gjvoosten gjvoosten merged commit 87fcbde into main May 16, 2024
19 checks passed
@gjvoosten gjvoosten deleted the AB-1083-move-countries-to-locations branch May 16, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants