Merge pull request #25707 from woocommerce/fix/as-460

Mark AS migration pending when updating WC to ensure migration happens.
This commit is contained in:
Peter Fabian 2020-02-25 22:03:45 +01:00 committed by GitHub
commit 7fdee5b03e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 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

@ -2092,6 +2092,18 @@ 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() {
if (
class_exists( 'ActionScheduler_DataController' ) &&
method_exists( 'ActionScheduler_DataController', 'mark_migration_incomplete' )
) {
\ActionScheduler_DataController::mark_migration_incomplete();
}
}
/**
* Update DB version.
*/