@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 PhabricatorUserEmail();
4$conn = $table->establishConnection('w');
5
6$iterator = new LiskRawMigrationIterator($conn, $table->getTableName());
7foreach ($iterator as $row) {
8 $phid = $row['phid'];
9
10 if (!strlen($phid)) {
11 queryfx(
12 $conn,
13 'UPDATE %R SET phid = %s WHERE id = %d',
14 $table,
15 $table->generatePHID(),
16 $row['id']);
17 }
18}