@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 PhabricatorOwnersPath();
4$conn = $table->establishConnection('w');
5
6$seen = array();
7foreach (new LiskMigrationIterator($table) as $path) {
8 $package_id = $path->getPackageID();
9 $repository_phid = $path->getRepositoryPHID();
10 $path_index = $path->getPathIndex();
11
12 if (!isset($seen[$package_id][$repository_phid][$path_index])) {
13 $seen[$package_id][$repository_phid][$path_index] = true;
14 continue;
15 }
16
17 queryfx(
18 $conn,
19 'DELETE FROM %T WHERE id = %d',
20 $table->getTableName(),
21 $path->getID());
22}