1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00
phorge-phorge/resources/sql/patches/migrate-maniphest-dependencies.php
Alex Monk 102e431feb Migrate Maniphest task blockers to modern EdgeType classes
Summary:
Prevents "edited tasks, added: 1; removed: 1"

Fixes T6757, using D9839 as an example

Test Plan: Added and removed blockers to/from tasks, saw the expected history entries.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T6757

Differential Revision: https://secure.phabricator.com/D11045
2014-12-28 06:40:39 -08:00

29 lines
605 B
PHP

<?php
echo "Migrating task dependencies to edges...\n";
$table = new ManiphestTask();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID();
echo "Task {$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 "OKAY\n";
}
$table->saveTransaction();
echo "Done.\n";