@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 PhabricatorUserPreferences();
4$conn_w = $table->establishConnection('w');
5
6foreach (new LiskMigrationIterator($table) as $row) {
7 if ($row->getPHID() !== '') {
8 continue;
9 }
10
11 queryfx(
12 $conn_w,
13 'UPDATE %T SET phid = %s WHERE id = %d',
14 $table->getTableName(),
15 $table->generatePHID(),
16 $row->getID());
17}