Skip to main content

Migration

A versioned change to a database schema, applied in order so every environment converges on the same structure.

Migrations that only move forward are easy to write and hard to recover from. Making each one backward compatible — add a column before writing to it, stop reading a column before dropping it — is what keeps rollback available.

See also