Glossary

Migration (DB)

A migration is a version of a database schema expressed as code. Instead of manually running SQL ALTER TABLE statements on each server, migrations are stored in the repository and applied with a single command on any environment.

Why it matters

Migrations solve the schema synchronisation problem between local, staging, and production. A new migration in code means a new change on all servers after running the migration command.

Typical structure

Each migration has two methods: up() — applies the schema change, down() — reverts it (rollback). The filename contains a timestamp to guarantee the application order.

Important rules