2

I have read the following article best practices for deployments.

https://craftcms.com/knowledge-base/deployment-best-practices

here the following is recommended:

git pull
composer install
php craft up

The problem here is if I have uninstalled a plugin that has tables they are not removed with the "php craft up" command.

I also tried the following instead of composer install -> php craft update/composer-install because I thought that this would be taken into account here but unfortunately it is not taken into account here either.

Is there a way to remove the tables automatically if this plugin has been removed or do I have to uninstall the plugins manually?

1 Answer 1

3

The trick is to do it in two separate steps…

  1. Uninstall the plugin via Craft. Push those changes all the way through to your production environment.
  2. Uninstall the plugin via Composer. Push those changes all the way through to your production environment.

By doing this as two distinct steps, it gives your production (and staging) environment a chance to properly run the plugin’s uninstall migrations while the composer package is still available. Once you remove the composer package (Step 2), the plugin won’t really know how to uninstall itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.