How to install DoctrineMigrationsBundle using composer in Symfony 2.3
1 minute read
DoctrineMigrationsBundle offers a safe way to migrate to newer versions of your database schema when deploying an application. It also help keeping track of your changes. Like git for the source code, but this is for database. The official documentation of DoctrineMigrationsBundle says in order to install the bundle to your application with composer, simply add this line to composer.json:
I have tried the code above but it failed with this error message:
The problem is, DoctrineMigrationsBundle depends on MigrationsBundle and the dependency cannot be satisfied because it’s not in the composer.json. So let’s add it then, this two lines should be added to the composer.json into the require section:
Then a php composer.phar update command should install the required dependencies as well.
Additionally, app/AppKernel.php should be changed too with: