Commit ce0ba337 authored by Michael Iseard's avatar Michael Iseard
Browse files

Move migrations to separate function

parent b2eb9f4d
......@@ -40,9 +40,28 @@ class ActivatorService {
$twig->init();
if ( $old_version ) {
self::run_migrations($old_version);
}
self::create_donors_table();
self::create_transactions_table();
self::create_subscriptions_table();
self::set_defaults();
$logger->info( 'Kudos Donations plugin activated' );
}
/**
* Run migrations if upgrading
*
* @param string $old_version
*
* @since 2.3.2
*/
public static function run_migrations( string $old_version ) {
if ( version_compare( $old_version, '2.1.1', '<' ) ) {
$logger->info( 'Upgrading to version 2.1.1', [ 'previous_version' => $old_version ] );
Settings::remove_setting( 'action_scheduler' );
}
......@@ -92,15 +111,6 @@ class ActivatorService {
}
self::create_donors_table();
self::create_transactions_table();
self::create_subscriptions_table();
self::set_defaults();
$logger->info( 'Kudos Donations plugin activated' );
}
/**
* Creates the donors table
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment