migrations
Doctrine Database Migrations Library
Doctrine Migrations is a PHP library for managing database schema changes in a controlled, versioned way. It is part of the broader Doctrine project, which provides database tools for PHP applications, and it works closely with Doctrine DBAL, the database abstraction layer that many PHP frameworks use under the hood.
When you build an application that writes data to a relational database, the structure of that database rarely stays fixed. You add a table for a new feature, rename a column, add an index to speed up a slow query, or drop a field that is no longer needed. Without a migration system, keeping those changes consistent across a development machine, a staging server, and a production database is error-prone. A developer might apply a change locally and forget to document it, leaving the production database out of sync.
Doctrine Migrations solves this by letting you write each schema change as a PHP class, stored as a timestamped file in version control. Each migration class has an up method that applies the change and a down method that reverses it. A command-line tool reads the database, compares what has been applied against what exists in the codebase, and runs only the missing steps in order. That way every environment can reach the same schema by running the same sequence of files.
The library is widely used in projects built on the Symfony PHP framework, though it works with any PHP application that uses Doctrine DBAL. Configuration, command references, and usage examples live in the external documentation linked from the repository. The README itself is minimal and points there directly.