[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/resources/sql/patches/ -> migrate-maniphest-dependencies.php (source)

   1  <?php
   2  
   3  echo "Migrating task dependencies to edges...\n";
   4  $table = new ManiphestTask();
   5  $table->openTransaction();
   6  
   7  foreach (new LiskMigrationIterator($table) as $task) {
   8    $id = $task->getID();
   9    echo "Task {$id}: ";
  10  
  11    $deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST);
  12    if (!$deps) {
  13      echo "-\n";
  14      continue;
  15    }
  16  
  17    $editor = new PhabricatorEdgeEditor();
  18    foreach ($deps as $dep) {
  19      $editor->addEdge(
  20        $task->getPHID(),
  21        PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK,
  22        $dep);
  23    }
  24    $editor->save();
  25    echo "OKAY\n";
  26  }
  27  
  28  $table->saveTransaction();
  29  echo "Done.\n";


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