]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/DatabaseStructure.php
Add missing L10n::popLang calls
[friendica.git] / src / Core / Console / DatabaseStructure.php
index ee8370dfa154c190c095b2dfd649da273c8d1f5b..4b607c1e6a36918c07d1957536c9c1da36dedd37 100644 (file)
@@ -11,9 +11,9 @@ require_once 'boot.php';
 require_once 'include/dba.php';
 
 /**
- * @brief Does database updates from the command line
+ * @brief Performs database updates from the command line
  *
- * @author Hypolite Petovan <mrpetovan@gmail.com>
+ * @author Hypolite Petovan <hypolite@mrpetovan.com>
  */
 class DatabaseStructure extends \Asika\SimpleConsole\Console
 {
@@ -22,7 +22,7 @@ class DatabaseStructure extends \Asika\SimpleConsole\Console
        protected function getHelp()
        {
                $help = <<<HELP
-console dbstructure - Does database updates
+console dbstructure - Performs database updates
 Usage
        bin/console dbstructure <command> [-h|--help|-?] [-v]
 
@@ -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;
                                        }