@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 PhabricatorMetaMTAMail();
4$conn_w = $table->establishConnection('w');
5
6echo pht('Assigning PHIDs to mails...')."\n";
7foreach (new LiskMigrationIterator($table) as $mail) {
8 $id = $mail->getID();
9
10 echo pht('Updating mail %d...', $id)."\n";
11 if ($mail->getPHID()) {
12 continue;
13 }
14
15 queryfx(
16 $conn_w,
17 'UPDATE %T SET phid = %s WHERE id = %d',
18 $table->getTableName(),
19 $table->generatePHID(),
20 $id);
21}
22echo pht('Done.')."\n";