# UUIDs

We have a branch called `recipes/uuid` that converts all "ids" to use the UUID6 type. We chose UUID6 as it allows for ordering due to its sequential nature.&#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.

#### New projects

You can either check out the branch and work off that or follow the [cherry-pick instructions](/petal-pro-documentation/v2.2.0/recipes/how-to-apply-a-recipe-with-git-cherry-pick.md) with the branch `recipes/npm`.

```
git clone https://github.com/petalframework/petal_pro.git
cd petal_pro
git checkout recipes/uuid
```

Once applied, you might need to run `mix ecto.reset` if you had already migrated the database previously.

#### Existing projects

If you already have a project in production then it will be a bit more difficult to update to use UUIDs. [This blog post](https://pawelurbanek.com/elixir-phoenix-uuid) has an example of a migration.


---

# 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/v2.2.0/recipes/uuids.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.
