Skip to catalogue

42

migration

A versioned, reversible change to the schema. Not “edit the database until it works.”

What is migration?

A migration is a checked-in script that moves the schema from A to B, with a way back. Expand/contract: add the new column, ship readers, then drop the old one.

Why does migration matter when vibe coding?

Models rewrite schema files in place and call it done. Production data is still on the old shape. You wanted a migration, not a new drawing of the table.

How do you do migration?

Never let the agent “just update the schema.” Demand a named migration, a rollback, and a note about existing rows.

How do you ask a model for migration?

Add a migration, not a schema rewrite. Existing rows must stay valid. Include a down/rollback. Do not drop columns in the same step you add their replacement.

What goes wrong with migration?

Destructive migrations on the first try. Expand, ship, then contract. The model will skip the middle if you let it.

adjacent