Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/britco/wp-cli-schema/archive/refs/heads/master.zipOn Packagist as britco/wp-cli-schema:
composer require britco/wp-cli-schemaNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
wp-cli-schema
Adds extra commands to wp-cli to do schema upgrades for
Wordpress. It allows you to do DB upgrades on deploy, instead of having to do
hacks like re-activating your plugin so it fires activation hooks again.
Also you don't have to worry about the PHP process timing out since it's
executed in the CLI context and not the browser.
Usage
In your plugin, add a hook for the schemaupgrade action. It should behave
similar to https://codex.wordpress.org/CreatingTableswithPlugins. You should
write it in a way where it can repeatedly run without harm. For example, if one
of your plugins needs to create a new term:
Add the schema upgrade to your deploy process
When this runs, it will essentially call doaction('schemaupgrade').
License
Available under the MIT License.