GitDoctrineMigrationBundle
GitDoctrineMigrationBundle is a helper for managing doctrine migrations and git branches., (*1)
Installation
Add the dependency:, (*2)
composer require raphaelvigee/git-doctrine-migration-bundle dev-master
Register in AppKernel.php
:, (*3)
$bundles = [
...
new RaphaelVigee\GitDoctrineMigrationBundle\RaphaelVigeeGitDoctrineMigrationBundle(),
...
];
Usage:
Prepare checkout:
bin/console doctrine:migrations:prepare-checkout <target>
The <target> should be a branch name (example: master
), (*4)
An SQL dump is created under var/git-doctrine-migration
, (*5)
Restore:
bin/console doctrine:migrations:restore
Restores the SQL dump corresponding to the current commit, (*6)