1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Correct RepositoryURI schema and propagate adjust exit code correctly

Summary:
Fixes T10830.

  - The return code from `storage adjust` did not propagate correct.
  - There was one column issue which I missed the first time around because I had a bunch of unrelated stuff locally.

Test Plan:
  - Ran `bin/storage upgrade -f` with failures, used `echo $?` to make sure it exited nonzero.
  - Got fully clean `bin/storage adjust` by dropping all my extra local tables.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10830

Differential Revision: https://secure.phabricator.com/D15746
This commit is contained in:
epriestley 2016-04-18 08:03:11 -07:00
parent d844e51127
commit 595f203816
3 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_repository.repository_uri
ADD credentialPHID VARBINARY(64);

View file

@ -40,6 +40,7 @@ final class PhabricatorRepositoryURI
'uri' => 'text255', 'uri' => 'text255',
'builtinProtocol' => 'text32?', 'builtinProtocol' => 'text32?',
'builtinIdentifier' => 'text32?', 'builtinIdentifier' => 'text32?',
'credentialPHID' => 'phid?',
'ioType' => 'text32', 'ioType' => 'text32',
'displayType' => 'text32', 'displayType' => 'text32',
'isDisabled' => 'bool', 'isDisabled' => 'bool',

View file

@ -61,7 +61,7 @@ abstract class PhabricatorStorageManagementWorkflow
} }
} }
$this->didExecute($args); return $this->didExecute($args);
} }
public function didExecute(PhutilArgumentParser $args) {} public function didExecute(PhutilArgumentParser $args) {}
@ -81,13 +81,15 @@ abstract class PhabricatorStorageManagementWorkflow
$lock = $this->lock(); $lock = $this->lock();
try { try {
$this->doAdjustSchemata($unsafe); $err = $this->doAdjustSchemata($unsafe);
} catch (Exception $ex) { } catch (Exception $ex) {
$lock->unlock(); $lock->unlock();
throw $ex; throw $ex;
} }
$lock->unlock(); $lock->unlock();
return $err;
} }
final private function doAdjustSchemata($unsafe) { final private function doAdjustSchemata($unsafe) {