From 595f203816913dd31d45ad608813cdcc9ede2f60 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 18 Apr 2016 08:03:11 -0700 Subject: [PATCH] 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 --- resources/sql/autopatches/20160418.repouri.2.sql | 2 ++ .../repository/storage/PhabricatorRepositoryURI.php | 1 + .../workflow/PhabricatorStorageManagementWorkflow.php | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 resources/sql/autopatches/20160418.repouri.2.sql diff --git a/resources/sql/autopatches/20160418.repouri.2.sql b/resources/sql/autopatches/20160418.repouri.2.sql new file mode 100644 index 0000000000..03884a3dfc --- /dev/null +++ b/resources/sql/autopatches/20160418.repouri.2.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_repository.repository_uri + ADD credentialPHID VARBINARY(64); diff --git a/src/applications/repository/storage/PhabricatorRepositoryURI.php b/src/applications/repository/storage/PhabricatorRepositoryURI.php index 9a93e261e4..163eafa120 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryURI.php +++ b/src/applications/repository/storage/PhabricatorRepositoryURI.php @@ -40,6 +40,7 @@ final class PhabricatorRepositoryURI 'uri' => 'text255', 'builtinProtocol' => 'text32?', 'builtinIdentifier' => 'text32?', + 'credentialPHID' => 'phid?', 'ioType' => 'text32', 'displayType' => 'text32', 'isDisabled' => 'bool', diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php index b500599956..7f969793ec 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php @@ -61,7 +61,7 @@ abstract class PhabricatorStorageManagementWorkflow } } - $this->didExecute($args); + return $this->didExecute($args); } public function didExecute(PhutilArgumentParser $args) {} @@ -81,13 +81,15 @@ abstract class PhabricatorStorageManagementWorkflow $lock = $this->lock(); try { - $this->doAdjustSchemata($unsafe); + $err = $this->doAdjustSchemata($unsafe); } catch (Exception $ex) { $lock->unlock(); throw $ex; } $lock->unlock(); + + return $err; } final private function doAdjustSchemata($unsafe) { -- 2.51.2