2012-07-19 05:41:42 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
echo "Migrating task dependencies to edges...\n";
|
2013-01-17 02:55:39 +01:00
|
|
|
$table = new ManiphestTask();
|
|
|
|
$table->openTransaction();
|
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator($table) as $task) {
|
2012-07-19 05:41:42 +02:00
|
|
|
$id = $task->getID();
|
|
|
|
echo "Task {$id}: ";
|
|
|
|
|
2014-07-24 00:05:46 +02:00
|
|
|
$deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST);
|
2012-07-19 05:41:42 +02:00
|
|
|
if (!$deps) {
|
|
|
|
echo "-\n";
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
|
|
foreach ($deps as $dep) {
|
|
|
|
$editor->addEdge(
|
|
|
|
$task->getPHID(),
|
2014-12-28 15:10:49 +01:00
|
|
|
ManiphestTaskDependsOnTaskEdgeType::EDGECONST,
|
2012-07-19 05:41:42 +02:00
|
|
|
$dep);
|
|
|
|
}
|
|
|
|
$editor->save();
|
|
|
|
echo "OKAY\n";
|
|
|
|
}
|
|
|
|
|
2013-01-17 02:55:39 +01:00
|
|
|
$table->saveTransaction();
|
2012-07-19 05:41:42 +02:00
|
|
|
echo "Done.\n";
|