DB conversion: improve console output

Signed-off-by: Simon Spannagel <simonspa@kth.se>
This commit is contained in:
Simon Spannagel 2020-12-07 07:06:56 +01:00 committed by Morris Jobke
parent 2445b9491e
commit 244e13cd43
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
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') {