mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-29 17:00:59 +01:00
8cbfb49b4e
Summary: Ref T5245. These were a bad idea. We no longer need actors for edge edits either, so remove those. Generally, edges have fit into the policy model as pure/low-level infrastructure, and they do not have any policy or capability information in and of themselves. Test Plan: `grep` Reviewers: chad, btrahan, joshuaspence Reviewed By: joshuaspence Subscribers: epriestley Maniphest Tasks: T5245 Differential Revision: https://secure.phabricator.com/D9840
35 lines
745 B
PHP
35 lines
745 B
PHP
<?php
|
|
|
|
echo "Migrating project members to edges...\n";
|
|
$table = new PhabricatorProject();
|
|
$table->establishConnection('w');
|
|
|
|
foreach (new LiskMigrationIterator($table) as $proj) {
|
|
$id = $proj->getID();
|
|
echo "Project {$id}: ";
|
|
|
|
$members = queryfx_all(
|
|
$proj->establishConnection('w'),
|
|
'SELECT userPHID FROM %T WHERE projectPHID = %s',
|
|
'project_affiliation',
|
|
$proj->getPHID());
|
|
|
|
if (!$members) {
|
|
echo "-\n";
|
|
continue;
|
|
}
|
|
|
|
$members = ipull($members, 'userPHID');
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
foreach ($members as $user_phid) {
|
|
$editor->addEdge(
|
|
$proj->getPHID(),
|
|
PhabricatorEdgeConfig::TYPE_PROJ_MEMBER,
|
|
$user_phid);
|
|
}
|
|
$editor->save();
|
|
echo "OKAY\n";
|
|
}
|
|
|
|
echo "Done.\n";
|