Page MenuHomec4science

migrate-maniphest-dependencies.php
No OneTemporary

File Metadata

Created
Tue, Dec 3, 10:16

migrate-maniphest-dependencies.php

<?php
echo pht('Migrating task dependencies to edges...')."\n";
$table = new ManiphestTask();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID();
echo pht('Task %d: ', $id);
$deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST);
if (!$deps) {
echo "-\n";
continue;
}
$editor = new PhabricatorEdgeEditor();
foreach ($deps as $dep) {
$editor->addEdge(
$task->getPHID(),
ManiphestTaskDependsOnTaskEdgeType::EDGECONST,
$dep);
}
$editor->save();
echo pht('OKAY')."\n";
}
$table->saveTransaction();
echo pht('Done.')."\n";

Event Timeline