diff --git a/resources/sql/patches/20130925.xpolicy.sql b/resources/sql/patches/20130925.xpolicy.sql new file mode 100644 index 0000000000..374a67543f --- /dev/null +++ b/resources/sql/patches/20130925.xpolicy.sql @@ -0,0 +1,17 @@ +ALTER TABLE {$NAMESPACE}_differential.differential_revision + ADD viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin; + +ALTER TABLE {$NAMESPACE}_differential.differential_revision + ADD editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin; + +UPDATE {$NAMESPACE}_differential.differential_revision + SET viewPolicy = 'users' WHERE viewPolicy = ''; + +UPDATE {$NAMESPACE}_differential.differential_revision + SET editPolicy = 'users' WHERE editPolicy = ''; + +ALTER TABLE {$NAMESPACE}_differential.differential_revision + ADD repositoryPHID VARCHAR(64) COLLATE utf8_bin; + +ALTER TABLE {$NAMESPACE}_differential.differential_revision + ADD KEY (repositoryPHID); diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 9f438e6b1f..ee98cc5dc0 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -25,6 +25,9 @@ final class DifferentialRevision extends DifferentialDAO protected $mailKey; protected $branchName; protected $arcanistProjectPHID; + protected $repositoryPHID; + protected $viewPolicy = PhabricatorPolicies::POLICY_USER; + protected $editPolicy = PhabricatorPolicies::POLICY_USER; private $relationships = self::ATTACHABLE; private $commits = self::ATTACHABLE; diff --git a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php index c748409609..006fa1d4c5 100644 --- a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php +++ b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php @@ -1632,6 +1632,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList { 'type' => 'sql', 'name' => $this->getPatchPath('20130925.mpolicy.sql'), ), + '20130925.xpolicy.sql' => array( + 'type' => 'sql', + 'name' => $this->getPatchPath('20130925.xpolicy.sql'), + ), ); } }