Skip to content
Snippets Groups Projects
Commit b5c9196f authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #17088 from owncloud/add-verbosity-to-upgrade

[upgrade] add verbosity check and show repair info & steps
parents 4e44cc49 17ff77c4
No related branches found
No related tags found
No related merge requests found
......@@ -178,6 +178,15 @@ class Upgrade extends Command {
$output->writeln("<error>$message</error>");
});
if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) {
$updater->listen('\OC\Updater', 'repairInfo', function ($message) use($output) {
$output->writeln('<info>Repair info: ' . $message . '</info>');
});
$updater->listen('\OC\Updater', 'repairStep', function ($message) use($output) {
$output->writeln('<info>Repair step: ' . $message . '</info>');
});
}
$success = $updater->upgrade();
$this->postUpgradeCheck($input, $output);
......
......@@ -239,6 +239,12 @@ class Updater extends BasicEmitter {
$repair->listen('\OC\Repair', 'error', function ($description) {
$this->emit('\OC\Updater', 'repairError', array($description));
});
$repair->listen('\OC\Repair', 'info', function ($description) {
$this->emit('\OC\Updater', 'repairInfo', array($description));
});
$repair->listen('\OC\Repair', 'step', function ($description) {
$this->emit('\OC\Updater', 'repairStep', array($description));
});
}
/**
......
......@@ -60,6 +60,7 @@ class Collation extends BasicEmitter implements \OC\RepairStep {
$tables = $this->getAllNonUTF8BinTables($this->connection);
foreach ($tables as $table) {
$this->emit('\OC\Repair', 'info', array("Change collation for $table ..."));
$query = $this->connection->prepare('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;');
$query->execute();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment