@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at recaptime-dev/main 35 lines 790 B view raw
1<?php 2 3echo pht('Migrating project members to edges...')."\n"; 4$table = new PhabricatorProject(); 5$table->establishConnection('w'); 6 7foreach (new LiskMigrationIterator($table) as $proj) { 8 $id = $proj->getID(); 9 echo pht('Project %d: ', $id); 10 11 $members = queryfx_all( 12 $proj->establishConnection('w'), 13 'SELECT userPHID FROM %T WHERE projectPHID = %s', 14 'project_affiliation', 15 $proj->getPHID()); 16 17 if (!$members) { 18 echo "-\n"; 19 continue; 20 } 21 22 $members = ipull($members, 'userPHID'); 23 24 $editor = new PhabricatorEdgeEditor(); 25 foreach ($members as $user_phid) { 26 $editor->addEdge( 27 $proj->getPHID(), 28 PhabricatorProjectProjectHasMemberEdgeType::EDGECONST, 29 $user_phid); 30 } 31 $editor->save(); 32 echo pht('OKAY')."\n"; 33} 34 35echo pht('Done.')."\n";