Differential D10603 Diff 25476 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php
Show All 11 Lines | $this | ||||
'Make schemata adjustments to correct issues with characters sets, '. | 'Make schemata adjustments to correct issues with characters sets, '. | ||||
'collations, and keys.')); | 'collations, and keys.')); | ||||
} | } | ||||
public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
$force = $args->getArg('force'); | $force = $args->getArg('force'); | ||||
$this->requireAllPatchesApplied(); | $this->requireAllPatchesApplied(); | ||||
$this->adjustSchemata($force); | return $this->adjustSchemata($force); | ||||
return 0; | |||||
} | } | ||||
private function requireAllPatchesApplied() { | private function requireAllPatchesApplied() { | ||||
$api = $this->getAPI(); | $api = $this->getAPI(); | ||||
$applied = $api->getAppliedPatches(); | $applied = $api->getAppliedPatches(); | ||||
if ($applied === null) { | if ($applied === null) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | for ($phase = 0; $phase < $phases; $phase++) { | ||||
} | } | ||||
} | } | ||||
$bar->done(); | $bar->done(); | ||||
if (!$failed) { | if (!$failed) { | ||||
$console->writeOut( | $console->writeOut( | ||||
"%s\n", | "%s\n", | ||||
pht('Completed fixing all schema issues.')); | pht('Completed fixing all schema issues.')); | ||||
return; | return 0; | ||||
} | } | ||||
$table = id(new PhutilConsoleTable()) | $table = id(new PhutilConsoleTable()) | ||||
->addColumn('target', array('title' => pht('Target'))) | ->addColumn('target', array('title' => pht('Target'))) | ||||
->addColumn('error', array('title' => pht('Error'))); | ->addColumn('error', array('title' => pht('Error'))); | ||||
foreach ($failed as $failure) { | foreach ($failed as $failure) { | ||||
list($adjust, $ex) = $failure; | list($adjust, $ex) = $failure; | ||||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |