@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// Populate account passwords (which we copied from the user table in the last
4// migration) with new PHIDs.
5
6$table = new PhabricatorAuthPassword();
7$conn = $table->establishConnection('w');
8
9$password_type = PhabricatorAuthPasswordPHIDType::TYPECONST;
10
11foreach (new LiskMigrationIterator($table) as $row) {
12 if (phid_get_type($row->getPHID()) == $password_type) {
13 continue;
14 }
15
16 $new_phid = $row->generatePHID();
17
18 queryfx(
19 $conn,
20 'UPDATE %T SET phid = %s WHERE id = %d',
21 $table->getTableName(),
22 $new_phid,
23 $row->getID());
24}