I want to install DoctrineMigrationsBundle in my project, but I couldn’t find any documentation to install the bundle using composer.json. I spend few hours to find the way of installation. So Let’s see how to do that.
DoctrineMigrationsBundle offers well and safe way to deploy new versions of your database schema. Find the corresponding documentation over here. So I tried below code to install the doctrine-migrations-bundle, but it was failed.
What I tried to install DoctrineMigrationsBundle!
{ "require": { "doctrine/doctrine-migrations-bundle": "dev-master" } }
What was the issue ?
Problem 1
– Installation request for doctrine/doctrine-migrations-bundle dev-master -> satisfiable by doctrine/doctrine-migrations-bundle dev-master.
– doctrine/doctrine-migrations-bundle dev-master requires doctrine/migrations * -> no matching package found.
Potential causes:
– A typo in the package name
– The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Above message clearly says doctrine-migrations-bundle required migrations. We also need to add that package in composer.json in require section.
Solution and Configuration
Step 1: Append it in composer.json require section.
{ "require": { "doctrine/migrations": "dev-master", "doctrine/doctrine-migrations-bundle": "dev-master" } }
Step 2: Now see the all goes green in your terminal.
php composer.phar update
Step 3: Configure in app/AppKernel.php.
// ... public function registerBundles() { $bundles = array( // ... new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), // ... ); // ... }
That’s all we done with installation DoctrineMigrationsBundle.
I have already answered similar question in Stack Overflow install DoctrineFixturesBundle and doctrine-fixtures in Symfony 2.1.4. Make it use if you need.
Hope this post helps you. Your all useful feedback’s are welcome.
Dude, this does not work in Symfony 2.1.7. I install the bundle successfully but Symfony can not load it. Can you help?
D:\xampp\htdocs\symblog.dev>php app/console doctrine:migrations:diff
Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not found in D:\xampp\htdocs\symblog.dev\app\
AppKernel.php on line 23
I think you have not installed DoctrineFixturesBundle. Please Install and check. I already answered how to install DoctrineFixturesBundle in Stack overflow. You can find the link in the bottom of post.