Remove configuration during module uninstall

If you have some configuration in your modules config/install directory, it didn’t get deleted during module uninstall routine. drush en -y YOURMODULE will throw an error if you try to reinstall your module. But during development – e.g. custom migrations – you will likely find you in a situation where you have repeatedly to to this. I tried the config_devel module. Sadly without much success.

Luckily since beta3 you can add (change record) enforced dependencies. Since then drush pmu -y YOURMODULE will uninstall your config item too.

You have to add:

dependencies:
  enforced:
    module:
      -YOURMODULE

to all of your config files.

So a drush pmu -y YOURMODULE && drush en -y YOURMODULE will give you a fresh reinstall with all the new config goodness. Not very elegant, but it works.

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting this form, you accept the Mollom privacy policy.