Migrate project membership to edges
Summary: - Store project members in edges. - Migrate existing members to edge storage. - Delete PhabricatorProjectAffiliation. - I left the actual underlying data around just in case something goes wrong; we can delete it evenutally. Test Plan: - Ran migration. - Created a new project. - Joined and left a project. - Added and removed project members. - Manually called PhabricatorOwnersOwner::loadAffiliatedUserPHIDs() to verify its behavior. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D3186
This commit is contained in:
@@ -81,10 +81,12 @@ final class PhabricatorProjectListController
|
||||
$profiles = mpull($profiles, null, 'getProjectPHID');
|
||||
}
|
||||
|
||||
$affil_groups = array();
|
||||
$edge_query = new PhabricatorEdgeQuery();
|
||||
if ($projects) {
|
||||
$affil_groups = PhabricatorProjectAffiliation::loadAllForProjectPHIDs(
|
||||
$project_phids);
|
||||
$edge_query
|
||||
->withSourcePHIDs($project_phids)
|
||||
->withEdgeTypes(array(PhabricatorEdgeConfig::TYPE_PROJ_MEMBER))
|
||||
->execute();
|
||||
}
|
||||
|
||||
$tasks = array();
|
||||
@@ -104,18 +106,17 @@ final class PhabricatorProjectListController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$rows = array();
|
||||
foreach ($projects as $project) {
|
||||
$phid = $project->getPHID();
|
||||
|
||||
$profile = idx($profiles, $phid);
|
||||
$affiliations = $affil_groups[$phid];
|
||||
$members = $edge_query->getDestinationPHIDs(array($phid));
|
||||
|
||||
$group = idx($groups, $phid, array());
|
||||
$task_count = count($group);
|
||||
|
||||
$population = count($affiliations);
|
||||
$population = count($members);
|
||||
|
||||
if ($profile) {
|
||||
$blurb = $profile->getBlurb();
|
||||
|
||||
Reference in New Issue
Block a user