[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/resources/sql/autopatches/ -> 20141113.auditdupes.php (source)

   1  <?php
   2  
   3  $table = new PhabricatorRepositoryAuditRequest();
   4  $conn_w = $table->establishConnection('w');
   5  
   6  echo "Removing duplicate Audit requests...\n";
   7  $seen_audit_map = array();
   8  foreach (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  
  22  echo "Done.\n";


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1