WP-CLI Schema
Adds 'schema' commands to wp-cli
★ 0stars
65composer installs
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/britco/wp-cli-schema/archive/refs/heads/master.zipAlso on Packagist as britco/wp-cli-schema:
composer require britco/wp-cli-schemaFrom the readme
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.