Skip to content

Create a migration script to split the name field into firstname and lastname. #1003

@John-Paul-Larkin

Description

@John-Paul-Larkin

Current behaviour:
Our user table currently has three “name” fields. The name field is populated by the user's name sourced from their GitHub profile.

New Onboarding Process:
We are introducing a new onboarding form to collect user metrics, which includes separate inputs for firstName and surName.

Migration Task:
We need to create an SQL/Node.js script to parse the existing name field into firstName and surName. These fields will be used in the onboarding form. If there are any issues with the migration (e.g., parsing errors or incorrect data), users will have the option to correct their names during the onboarding process.

ChatGPT kindly suggested these possible migration issues:

Multiple first names: Example: John Paul Larkin – "Larkin" could be incorrectly parsed as a last name.
Single word names: Example: Madonna – No last name available for splitting.
Prefixes/suffixes: Example: Dr. John Smith Jr. – Prefixes or suffixes may be included in the wrong field.
Hyphenated names: Example: Anna-Marie Johnson – Hyphenated names might split incorrectly.
Non-Western names: Example: Wang Xiaoming – Family names might come first.
Apostrophes or special characters: Example: O'Connor – Special characters could cause errors.
Formatting issues: Example: John Doe or JaneDoe – Extra spaces or no spaces at all.
Empty names: Users may not have a name set in their GitHub profile.

Connected issues
#1003
#1004
#1005
#1006
#1008
#1009
#1011

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions