Merge pull request #24580 from nextcloud/enh/noid/db-convert

DB conversion: improve console output
This commit is contained in:
Morris Jobke 2021-03-17 17:52:42 +01:00 committed by GitHub
commit 6867ba8e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -246,6 +246,7 @@ class ConvertType extends Command implements CompletionAwareInterface {
$schemaManager = new \OC\DB\MDB2SchemaManager($toDB);
$apps = $input->getOption('all-apps') ? \OC_App::getAllApps() : \OC_App::getEnabledApps();
foreach ($apps as $app) {
$output->writeln('<info> - '.$app.'</info>');
if (file_exists(\OC_App::getAppPath($app).'/appinfo/database.xml')) {
$schemaManager->createDbFromStructure(\OC_App::getAppPath($app).'/appinfo/database.xml');
} else {
@ -327,6 +328,7 @@ class ConvertType extends Command implements CompletionAwareInterface {
}
$progress = new ProgressBar($output, $count);
$progress->setFormat('very_verbose');
$progress->start();
$redraw = $count > $chunkSize ? 100 : ($count > 100 ? 5 : 1);
$progress->setRedrawFrequency($redraw);
@ -382,6 +384,7 @@ class ConvertType extends Command implements CompletionAwareInterface {
$result->closeCursor();
}
$progress->finish();
$output->writeln('');
}
protected function getColumnType(Table $table, $columnName) {
@ -414,7 +417,7 @@ class ConvertType extends Command implements CompletionAwareInterface {
try {
// copy table rows
foreach ($tables as $table) {
$output->writeln($table);
$output->writeln('<info> - '.$table.'</info>');
$this->copyTable($fromDB, $toDB, $schema->getTable($table), $input, $output);
}
if ($input->getArgument('type') === 'pgsql') {