Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Iseard
Kudos-Donations
Commits
ce0ba337
Commit
ce0ba337
authored
Feb 04, 2021
by
Michael Iseard
Browse files
Move migrations to separate function
parent
b2eb9f4d
Changes
1
Show whitespace changes
Inline
Side-by-side
app/Service/ActivatorService.php
View file @
ce0ba337
...
...
@@ -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
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment