@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 PhabricatorCalendarEvent();
4$conn_w = $table->establishConnection('w');
5
6echo pht('Assigning PHIDs to events...')."\n";
7foreach (new LiskMigrationIterator($table) as $event) {
8 $id = $event->getID();
9
10 echo pht('Updating event %d...', $id)."\n";
11 if ($event->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";