@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 PhabricatorRepositoryAuditRequest();
4$conn_w = $table->establishConnection('w');
5
6echo pht('Migrating Audit subscribers to subscriptions...')."\n";
7foreach (new LiskMigrationIterator($table) as $request) {
8 $id = $request->getID();
9
10 echo pht("Migrating audit %d...\n", $id);
11
12 if ($request->getAuditStatus() != 'cc') {
13 // This isn't a "subscriber", so skip it.
14 continue;
15 }
16
17 queryfx(
18 $conn_w,
19 'INSERT IGNORE INTO %T (src, type, dst) VALUES (%s, %d, %s)',
20 PhabricatorEdgeConfig::TABLE_NAME_EDGE,
21 $request->getCommitPHID(),
22 PhabricatorObjectHasSubscriberEdgeType::EDGECONST,
23 $request->getAuditorPHID());
24
25
26 // Wipe the row.
27 $request->delete();
28}
29
30echo pht('Done.')."\n";