We now have a pre update script (#5425)

* We now have a pre update script

* Some optimized stuff
This commit is contained in:
Michael Vogel 2018-07-20 21:47:16 +02:00 committed by Hypolite Petovan
parent b26da6096b
commit 4bbcb61a9e
3 changed files with 40 additions and 19 deletions

View file

@ -69,8 +69,6 @@ HELP;
$output = DBStructure::update(true, false);
break;
case "update":
$output = DBStructure::update(true, true);
$build = Core\Config::get('system', 'build');
if (empty($build)) {
Core\Config::set('system', 'build', DB_UPDATE_VERSION);
@ -80,9 +78,19 @@ HELP;
$stored = intval($build);
$current = intval(DB_UPDATE_VERSION);
// run any left update_nnnn functions in update.php
// run the pre_update_nnnn functions in update.php
for ($x = $stored; $x < $current; $x ++) {
$r = run_update_function($x);
$r = run_update_function($x, 'pre_update');
if (!$r) {
break;
}
}
$output = DBStructure::update(true, true);
// run the update_nnnn functions in update.php
for ($x = $stored; $x < $current; $x ++) {
$r = run_update_function($x, 'update');
if (!$r) {
break;
}