From 9352ed8abbd2d2aeb782db87d74695667bc1bc9c Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 18 Apr 2016 04:44:45 -0700 Subject: [PATCH] Add missing RepositoryURI table + run storage adjustments in tests Summary: Fixes T10830. Ref T10366. I wasn't writing to this table yet so I didn't build it, but the fact that `bin/storage adjust` would complain slipped my mind. - Add the table. - Make the tests run `adjust`. This is a little slow (a few extra seconds) but we could eventually move some steps like this to run server-side only. Test Plan: Ran `bin/storage upgrade -f`, got a clean `adjust`. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10366, T10830 Differential Revision: https://secure.phabricator.com/D15744 --- resources/sql/autopatches/20160418.repouri.1.sql | 14 ++++++++++++++ .../storage/PhabricatorRepositoryURI.php | 2 +- .../PhabricatorStorageFixtureScopeGuard.php | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 resources/sql/autopatches/20160418.repouri.1.sql diff --git a/resources/sql/autopatches/20160418.repouri.1.sql b/resources/sql/autopatches/20160418.repouri.1.sql new file mode 100644 index 0000000000..89f48b4291 --- /dev/null +++ b/resources/sql/autopatches/20160418.repouri.1.sql @@ -0,0 +1,14 @@ +CREATE TABLE {$NAMESPACE}_repository.repository_uri ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + phid VARBINARY(64) NOT NULL, + repositoryPHID VARBINARY(64) NOT NULL, + uri VARCHAR(255) NOT NULL COLLATE {$COLLATE_TEXT}, + builtinProtocol VARCHAR(32) COLLATE {$COLLATE_TEXT}, + builtinIdentifier VARCHAR(32) COLLATE {$COLLATE_TEXT}, + ioType VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT}, + displayType VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT}, + isDisabled BOOL NOT NULL, + dateCreated INT UNSIGNED NOT NULL, + dateModified INT UNSIGNED NOT NULL, + UNIQUE KEY `key_builtin` (repositoryPHID, builtinProtocol, builtinIdentifier) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; diff --git a/src/applications/repository/storage/PhabricatorRepositoryURI.php b/src/applications/repository/storage/PhabricatorRepositoryURI.php index c91861918f..9a93e261e4 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryURI.php +++ b/src/applications/repository/storage/PhabricatorRepositoryURI.php @@ -37,7 +37,7 @@ final class PhabricatorRepositoryURI return array( self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array( - 'uri' => 'text', + 'uri' => 'text255', 'builtinProtocol' => 'text32?', 'builtinIdentifier' => 'text32?', 'ioType' => 'text32', diff --git a/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php b/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php index 2624427dc8..3a10f77bc7 100644 --- a/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php +++ b/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php @@ -11,7 +11,7 @@ final class PhabricatorStorageFixtureScopeGuard extends Phobject { $this->name = $name; execx( - 'php %s upgrade --force --no-adjust --namespace %s', + 'php %s upgrade --force --namespace %s', $this->getStorageBinPath(), $this->name);