A database migration is a controlled change to the structure of a database, such as adding tables, modifying columns, or updating indexes. Migrations are typically scripted and versioned alongside code so changes can be applied consistently across environments. Tools like Flyway, Liquibase, and ORM migration systems automate the process and reduce manual errors.
Why it matters
As an application evolves, its database schema must evolve with it. Migrations ensure that schema changes are predictable, reversible, and synchronized across development, staging, and production environments. They also integrate with CI/CD pipelines to make deployment safer.
Examples
Adding a new column called last_login to the users table or creating a join table for relationships are database migrations. Lessons such as Database Migrations in Deployment explain how migrations fit into release workflows.