Remove obsolete profile.dfrn_request field #87

Merged
heluecht merged 8 commits from MrPetovan/friendica-directory:task/86-remove-dfrn_request into stable 2022-05-11 06:17:42 +02:00
1 changed files with 29 additions and 5 deletions
Showing only changes of commit b0142f6ab2 - Show all commits

View File

@ -37,12 +37,14 @@ class UpdateDb extends \Asika\SimpleConsole\Console
$help = <<<HELP
console updatedb - Update database schema
Usage
bin/console updatedb [-h|--help|-?] [-v]
bin/console updatedb [<version>] [-h|--help|-?] [-v]
Description
Update database schema
Options
<version> Optional target version number, default is the latest version.
Do not use this parameter if you're not sure what you're doing, it will result in data loss!
-h|--help|-? Show help information
-v Show more debug information.
HELP;
@ -56,16 +58,38 @@ HELP;
return 0;
}
if (count($this->args) > 1) {
if (count($this->args) > 2) {
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
}
$this->out('Updating database schema to latest version...');
$currentVersion = $this->migration->getCurrentVersion()['version'];
$this->migration->up();
$this->out('Database schema currently in version ' . $currentVersion);
$this->out('Database schema migrated to version ' . $this->migration->getCurrentVersion()['version']);
if (count($this->args) == 1) {
$this->out('Updating database schema to latest version...');
$this->migration->up();
$this->out('Database schema migrated to version ' . $this->migration->getCurrentVersion()['version']);
return 0;
}
$target = $this->getArgument(1);
if ($target > $currentVersion) {
$this->out('Updating database schema to version ' . $target);
$this->migration->up($target);
$this->out('Database schema migrated up to version ' . $this->migration->getCurrentVersion()['version']);
return 0;
}
if ($target < $currentVersion) {
$this->out('Downgrading database schema to version ' . $target);
$this->migration->down($target);
$this->out('Database schema migrated down to version ' . $this->migration->getCurrentVersion()['version']);
return 0;
}
$this->out('Target version equal to current version, exiting.');
return 0;
}
}