Skip to content
>devspeak
← glossary
level 4Databases

Migration

also: migrations, migrate, migrated, database migration, schema migration

A saved set of steps that changes your database's structure, like adding a column or a table, so every copy of the database can be updated the same way.

a bit more technical

A versioned script that moves the schema, and sometimes existing data, from one version to the next. Migrations run in order and are tracked, so development, staging and production databases stay in sync.

picture it

Renovation plans for a building people live in. "Add a doorway here" is easy on paper, but with residents inside you plan carefully. Your existing data is the residents.

why it matters

Migrations are where agent work touches real data. Bad code can be rolled back in minutes. A migration that drops or rewrites production data may not be reversible. Review migrations before they run on production.

what your agent might say
agent
The migration failed because several legacy records violate the newly introduced non-null foreign-key constraint.
how you might use it
you → your agent
Write the migration but don't run it on production. Explain what it does to existing data and whether it can be reversed. We'll take a backup first.
common mistake

Thinking a migration only changes code. It changes the database itself, and on production that means real users' data.

builds on