First/Last name
Was this helpful?
Was this helpful?
This recipe splits user.name
into user.first_name
and user.last_name
.
Note: this has been rebased on the latest main
branch and might not work properly on v1.3.0 and below. However, you should be able to work out how to apply it based on the diffs.
Also note that this recipe modifies an existing migration that may have been migrated in your project already.
If your project is in production you'll have to undo that migration change and create a new migration that removes the name
field and adds first_name
and last_name
fields. For local projects, you can just run mix ecto.reset
.
You can choose to check out the branch or cherry pick it.
Follow the with the branch recipes/first-name-last-name
.