mirror of
https://github.com/friendica/friendica
synced 2025-04-25 07:10:11 +00:00
Ability to set the database version
This commit is contained in:
parent
cb647b5b6c
commit
50b5483ee1
3 changed files with 27 additions and 2 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue