]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBStructure.php
Merge pull request #9146 from tobiasd/2020.09-CHANGELOG
[friendica.git] / src / Database / DBStructure.php
index bf76eccacb50edd3b6f19dcea3360477d3fc4e3c..bdd8cc208efe2e829183ef3e2ab6ab74d75c802a 100644 (file)
@@ -48,6 +48,22 @@ class DBStructure
         */
        private static $definition = [];
 
+       /**
+        * Set a database version to trigger update functions
+        *
+        * @param string $version
+        * @return void
+        */
+       public static function setDatabaseVersion(string $version)
+       {
+               if (!is_numeric($version)) {
+                       throw new \Asika\SimpleConsole\CommandArgsException('The version number must be numeric');
+               }
+
+               DI::config()->set('system', 'build', $version);
+               echo DI::l10n()->t('The database version had been set to %s.', $version);
+       }
+
        /**
         * Converts all tables from MyISAM/InnoDB Antelope to InnoDB Barracuda
         */