Merge pull request #31979 from woocommerce/add/commment-about-db-updates-on-install

Add code comments clarifying database updates on new WooCommerce installs
This commit is contained in:
Jorge A. Torres 2022-03-14 16:20:46 -05:00 committed by GitHub
commit 7ffd4f2f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -21,6 +21,13 @@ class WC_Install {
/**
* DB updates and callbacks that need to be run per version.
*
* Please note that these functions are invoked when WooCommerce is updated from a previous version,
* but NOT when WooCommerce is newly installed.
*
* Database schema changes must be incorporated to the SQL returned by get_schema, which is applied
* via dbDelta at both install and update time. If any other kind of database change is required
* at install time (e.g. populating tables), use the 'woocommerce_installed' hook.
*
* @var array
*/
private static $db_updates = array(

View File

@ -2,7 +2,15 @@
/**
* WooCommerce Updates
*
* Functions for updating data, used by the background updater.
* Functions for updating data, used by the background updater. These functions must be included
* in the list returned by WC_Install::get_db_update_callbacks.
*
* Please note that these functions are invoked when WooCommerce is updated from a previous version,
* but NOT when WooCommerce is newly installed.
*
* Database schema changes must be incorporated to the SQL returned by WC_Install::get_schema, which is applied
* via dbDelta at both install and update time. If any other kind of database change is required
* at install time (e.g. populating tables), use the 'woocommerce_installed' hook.
*
* @package WooCommerce\Functions
* @version 3.3.0