Data

Migration

A versioned, repeatable change to your database structure.

A migration is a recorded step that alters your schema — 'add a phone_number column,' 'create the orders table' — that can be applied consistently to every environment (your laptop, staging, production). It's like a git commit for your database structure: each change is tracked in order, so a teammate or a fresh deploy ends up with the exact same shape. The critical rule is you never edit the production database by hand; you write a migration and run it, so the change is reviewable and reversible. When AI changes your schema, make sure it generates a migration too, otherwise the code and the real database drift apart and things break at deploy.

Related terms