This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I'm following some third part projects developed with octobercms version 1.0. If I need to remove a plugin in locale is quite easy: 'php artisan plugin:remove' and it removes all plugin tables from the db and all the files. With the versioning control system I update the production and then the plugin dir and all the files are removed. But what about the db? How can I sync the production db without doing it manually?
Hi Bob,
Take a look at this configuration item in the config/system.php file:
/*
|--------------------------------------------------------------------------
| Automatically Rollback Plugins
|--------------------------------------------------------------------------
|
| Attempt to automatically reverse database migrations for a plugin when
| they are uninstalled using composer. This is disabled by default
| to prevent data loss.
|
*/
'auto_rollback_plugins' => env('AUTO_ROLLBACK_PLUGINS', false),
Set this value to true
and it should attempt to rollback your plugin in the database before the package is removed by composer.
You may also manually rollback a plugin before removing it via composer using the plugin:refresh
command.
php artisan plugin:refresh Acme.Demo --rollback
I hope this helps
Thanks @daftpunk. I think I understand that the best way to get in sync local with production during a plugin remove is to call the artisan rollback command in the production environment and then pull the commit where the plugin is removed.
Last updated
Yes, that's right. The plugin needs to exist in the filesystem during the rollback so the down()
migration scripts can be accessed and executed.
Last updated
1-4 of 4