Differential D16848 Diff 40576 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php
| Show All 21 Lines | $this | ||||
| 'titles).'), | 'titles).'), | ||||
| ), | ), | ||||
| )); | )); | ||||
| } | } | ||||
| public function didExecute(PhutilArgumentParser $args) { | public function didExecute(PhutilArgumentParser $args) { | ||||
| $unsafe = $args->getArg('unsafe'); | $unsafe = $args->getArg('unsafe'); | ||||
| $this->requireAllPatchesApplied(); | foreach ($this->getMasterAPIs() as $api) { | ||||
| return $this->adjustSchemata($unsafe); | $this->requireAllPatchesApplied($api); | ||||
| $err = $this->adjustSchemata($api, $unsafe); | |||||
| if ($err) { | |||||
| return $err; | |||||
| } | |||||
| } | |||||
| return 0; | |||||
| } | } | ||||
| private function requireAllPatchesApplied() { | private function requireAllPatchesApplied( | ||||
| $api = $this->getAPI(); | PhabricatorStorageManagementAPI $api) { | ||||
| $applied = $api->getAppliedPatches(); | $applied = $api->getAppliedPatches(); | ||||
| if ($applied === null) { | if ($applied === null) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'You have not initialized the database yet. You must initialize '. | 'You have not initialized the database yet. You must initialize '. | ||||
| 'the database before you can adjust schemata. Run `%s` '. | 'the database before you can adjust schemata. Run `%s` '. | ||||
| 'to initialize the database.', | 'to initialize the database.', | ||||
| Show All 21 Lines | |||||