Page MenuHomec4science

migrate-maniphest-dependencies.php
No OneTemporary

File Metadata

Created
Fri, Sep 27, 01:39

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