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.
Each migration has two methods: up() — applies the schema change, down() — reverts it (rollback). The filename contains a timestamp to guarantee the application order.
gh-ost or pt-online-schema-change