]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/DatabaseStructure.php
Merge pull request #5599 from annando/postupdate
[friendica.git] / src / Core / Console / DatabaseStructure.php
index ee8370dfa154c190c095b2dfd649da273c8d1f5b..1b64622dbff105c60d8e5d4f420e9e15a08669b9 100644 (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, '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);
+                                       $r = run_update_function($x, 'update');
                                        if (!$r) {
                                                break;
                                        }