@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('Removing duplicate Audit requests...')."\n";
7$seen_audit_map = array();
8foreach (new LiskMigrationIterator($table) as $request) {
9 $commit_phid = $request->getCommitPHID();
10 $auditor_phid = $request->getAuditorPHID();
11 if (isset($seen_audit_map[$commit_phid][$auditor_phid])) {
12 $request->delete();
13 }
14
15 if (!isset($seen_audit_map[$commit_phid])) {
16 $seen_audit_map[$commit_phid] = array();
17 }
18
19 $seen_audit_map[$commit_phid][$auditor_phid] = 1;
20}
21
22echo pht('Done.')."\n";