# First/Last name

This recipe splits `user.name` into `user.first_name` and `user.last_name`.&#x20;

### How to use

**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.&#x20;

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`.

#### New projects

You can choose to check out the branch or cherry pick it.

```
git clone https://github.com/petalframework/petal_pro.git
cd petal_pro
git checkout recipes/first-name-last-name
```

#### Cherry pick

Follow the [cherry-pick instructions](/petal-pro-documentation/v1.5.2/recipes/how-to-apply-a-recipe-with-git-cherry-pick.md) with the branch `recipes/first-name-last-name`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.petal.build/petal-pro-documentation/v1.5.2/recipes/first-last-name.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
