Mark AS migration pending when updating WC to ensure migration happens.

Ideally https://github.com/woocommerce/action-scheduler/pull/470 should take care of this issue, but since we have AS 3.x in the wild without fix in the PR, this change is also necessary.
This commit is contained in:
vedanshujain 2020-02-19 18:19:11 +05:30
parent fa1f18e7c1
commit 90ab985cfb
2 changed files with 8 additions and 0 deletions

View File

@ -146,6 +146,7 @@ class WC_Install {
'wc_update_product_lookup_tables',
'wc_update_400_increase_size_of_column',
'wc_update_400_db_version',
'wc_reset_action_scheduler_migration_status',
),
);

View File

@ -2091,6 +2091,13 @@ function wc_update_400_increase_size_of_column() {
$wpdb->query( "ALTER TABLE {$wpdb->prefix}wc_product_meta_lookup MODIFY COLUMN `max_price` decimal(19,4) NULL default NULL" );
}
/**
* Reset ActionScheduler migration status. Needs AS >= 3.0 shipped with WC >= 4.0.
*/
function wc_reset_action_scheduler_migration_status() {
\ActionScheduler_DataController::mark_migration_incomplete();
}
/**
* Update DB version.
*/