mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-28 16:30:59 +01:00
Add some keys and policy fields to repositories
Summary: - Add some TODO'd keys. - Add policy fields. Test Plan: Viewed repositories; created a new repository and verified it got the right default policy settings. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7056
This commit is contained in:
parent
e1892e9bfb
commit
b8cb6ddaa5
4 changed files with 26 additions and 4 deletions
20
resources/sql/patches/20130920.repokeyspolicy.sql
Normal file
20
resources/sql/patches/20130920.repokeyspolicy.sql
Normal file
|
@ -0,0 +1,20 @@
|
|||
ALTER TABLE {$NAMESPACE}_repository.repository_summary
|
||||
ADD KEY `key_epoch` (epoch);
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_repository.repository
|
||||
ADD KEY `key_name` (name);
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_repository.repository
|
||||
ADD KEY `key_vcs` (versionControlSystem);
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_repository.repository
|
||||
ADD viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_repository.repository
|
||||
ADD editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin;
|
||||
|
||||
UPDATE {$NAMESPACE}_repository.repository
|
||||
SET viewPolicy = 'users' WHERE viewPolicy = '';
|
||||
|
||||
UPDATE {$NAMESPACE}_repository.repository
|
||||
SET editPolicy = 'admin' WHERE editPolicy = '';
|
|
@ -147,9 +147,6 @@ final class PhabricatorRepositoryQuery
|
|||
|
||||
protected function getPagingColumn() {
|
||||
|
||||
// TODO: Add a key for ORDER_NAME.
|
||||
// TODO: Add a key for ORDER_COMMITTED.
|
||||
|
||||
$order = $this->order;
|
||||
switch ($order) {
|
||||
case self::ORDER_CREATED:
|
||||
|
@ -290,7 +287,6 @@ final class PhabricatorRepositoryQuery
|
|||
$this->callsigns);
|
||||
}
|
||||
|
||||
// TODO: Add a key for this.
|
||||
if ($this->types) {
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
|
|
|
@ -29,6 +29,8 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
|||
protected $name;
|
||||
protected $callsign;
|
||||
protected $uuid;
|
||||
protected $viewPolicy = PhabricatorPolicies::POLICY_USER;
|
||||
protected $editPolicy = PhabricatorPolicies::POLICY_ADMIN;
|
||||
|
||||
protected $versionControlSystem;
|
||||
protected $details = array();
|
||||
|
|
|
@ -1608,6 +1608,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
|
|||
'type' => 'php',
|
||||
'name' => $this->getPatchPath('20130919.mfieldconf.php'),
|
||||
),
|
||||
'20130920.repokeyspolicy.sql' => array(
|
||||
'type' => 'sql',
|
||||
'name' => $this->getPatchPath('20130920.repokeyspolicy.sql'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue