Before you beginYou need the cluck CLI, a Pollosoft account, and a coop to work in. No prior experience required. Curiosity and a mild fondness for chickens are helpful.
Overview
Change your database schema without taking the service offline. The whole thing takes about 13 minutes, and the commands below are the ones you will use along the way.
$ cluck molt new add-orders-index
$ cluck molt run --dry-run
$ cluck molt run
Steps
- Write small migrations. One change per migration. If a migration needs a comment longer than the code, split it.
- Dry run. cluck molt run --dry-run shows the SQL it would execute and estimates lock time.
- Expand, migrate, contract. Add the new column, backfill it, switch reads, then drop the old column. Never skip a step to save a day.
- Roll back. Every migration has a down path. Test it. A rollback you have never run is a rumor.
Commands used
Keep going
- Hatching a project with Hatchback (7 min)
- Getting started (8 min)
- Accessibility at the coop (10 min)
Stuck? Check the error codes, the FAQ, or the glossary.