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

Add viewPolicy, editPolicy, repositoryPHID columns to DifferentialRevision

Summary: Ref T603. Paves the way for policy controls.

Test Plan: Ran storage upgrade, bumbled around in Differential.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7133
This commit is contained in:
epriestley 2013-09-26 12:36:30 -07:00
parent 79abe6653e
commit c458517cb4
3 changed files with 24 additions and 0 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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'),
),
);
}
}