LogoLogo
v2.0.0
v2.0.0
  • 🌸What is Petal Pro?
  • πŸ’‘Changelog
  • ⏫Upgrade guide
  • Guides
    • πŸš€Creating a web app from start to finish
    • 🌎Deploy to Fly.io
    • πŸ’³Adding a subscription
    • πŸ”’Creating Your Own API
  • πŸ‘©β€πŸ³Recipes
    • πŸ’How to apply a recipe with git cherry pick
    • #️⃣UUIDs
    • ✍️First/Last name
    • πŸ—ΊοΈGoogle Maps
    • Password Hashing for Windows
  • Fundamentals
    • πŸ’ΏInstallation
    • πŸ“‚Folder structure
    • πŸ—ƒοΈIncluded Pages
    • πŸ˜€Users & Authentication
    • 🏒Organizations & Multitenancy
    • πŸ’³Stripe billing
    • πŸ””User Notifications
    • 🧊Components
    • ⬛Dark mode
    • 🎨Branding
    • 🌱Seeding
    • πŸ“„Layouts & Menus
    • πŸ–ΌοΈImage uploads
    • πŸ‘₯Impersonation
    • πŸ› οΈBackground Tasks and Jobs
    • πŸ”§Util & Helpers
    • πŸ“§Emails
    • πŸͺJavascript Hooks
    • πŸ“šExtra Hex Libraries
    • πŸ—οΈGenerators
    • πŸ—£οΈTranslations
    • πŸ–οΈContributing
    • πŸ›«Deployment
    • πŸ›‘οΈTesting
    • πŸ”’REST API
Powered by GitBook
On this page

Was this helpful?

  1. Recipes

UUIDs

PreviousHow to apply a recipe with git cherry pickNextFirst/Last name

Last updated 9 months ago

Was this helpful?

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.

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 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. has an example of a migration.

πŸ‘©β€πŸ³
#️⃣
cherry-pick instructions
This blog post