You are browsing a version that is no longer maintained.


The Doctrine Migrations project offers additional functionality on top of the DBAL and ORM for versioning your database schema. It makes it easy and safe to deploy changes to it in a way that can be reviewed and tested before being deployed to production.


You can use the Doctrine Migrations project by installing it with Composer or by downloading the latest PHAR from the releases page on GitHub.

For this documentation exercise we will assume you are starting a new project so create a new folder to work in:

$ mkdir /data/doctrine/migrations-docs-example
$ cd /data/doctrine/migrations-docs-example


Now to install with Composer it is as simple as running the following command in your project.

$ composer require "doctrine/migrations:^2.0"

Now you will have a file in vendor/bin available to run the migrations console application:

$ ./vendor/bin/doctrine-migrations


To install by downloading the PHAR, you just need to download the latest PHAR file from the releases page on GitHub.

Here is an example using the 2.0.0 release:

$ wget

Now you can execute the PHAR like this:

$ php doctrine-migrations.phar

Next Chapter: Configuration