@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
1<?php
2
3$table = new HeraldRule();
4$conn_w = $table->establishConnection('w');
5
6echo pht('Assigning PHIDs to Herald Rules...')."\n";
7
8foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
9 $id = $rule->getID();
10 echo pht('Rule %d.', $id)."\n";
11
12 if ($rule->getPHID()) {
13 continue;
14 }
15
16 queryfx(
17 $conn_w,
18 'UPDATE %T SET phid = %s WHERE id = %d',
19 $table->getTableName(),
20 PhabricatorPHID::generateNewPHID(HeraldRulePHIDType::TYPECONST),
21 $rule->getID());
22}
23
24echo pht('Done.')."\n";