mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #17088 from owncloud/add-verbosity-to-upgrade
[upgrade] add verbosity check and show repair info & steps
This commit is contained in:
commit
b5c9196ffc
3 changed files with 16 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue