2.0 #33

wants to merge 1 commit into


None yet
4 participants

The Doctrine Migrations help from the command line says you can pass in a configuration file to indicate the location that the migrations should be saved and executed from. However, it didn't appear that works. The actual doctrine-migrations library supports this, however the Bundle seems to ignore whatever the doctrine-migrations library uses for the configuration directory and instead uses the doctrine_migrations.dir_name configuration value.

Unfortunately, that doesn't work well because the doctrine-migrations library does not work with doctrine_migrations.dir_name, it wants migrations_directory in the configuration. Thus this change allows you to point to a specific directory from a configuration file to tell the library where to manage your migrations from.

This works if you have several bundles under the same Symfony installation and each of them have completely different databases and configuration.

Another alternative would to just have a --dir option that you pass in to indicate where migrations should be run from.

Vic Cherubini Fixed the configureMigrations() method to respect the --configuration…
… parameter which can overwrite where migrations are saved to and used.

DRvanR commented Aug 15, 2012


This really ought to be fixed...

as another use-case for this fix:
for different environments we want to populate the db with different sets of data. Due to the limitation that is fixed in this pr, we're simply not able to. Currently resorted to using data-fixtures, but that purges the database of all data, which is useful in some case and plain dangerous in other cases.

I agree that this should be fixed. Pull request from SterinGM also addresses this same issue: #58
But that one also fixes the other configuration options being overwritten.


stof commented Jul 5, 2013

The 2.0 branch of the bundle is not maintained anymore as Symfony 2.0 reached it end of maintenance already

Ok. But the issue is still relevant. The pull request I referenced in the previous comment is for the master branch.

stof closed this Jul 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment