1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00
phorge-phorge/resources/sql/patches/migrate-differential-dependencies.php

30 lines
630 B
PHP
Raw Normal View History

<?php
echo "Migrating differential dependencies to edges...\n";
$table = new DifferentialRevision();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $rev) {
$id = $rev->getID();
echo "Revision {$id}: ";
$deps = $rev->getAttachedPHIDs(DifferentialPHIDTypeRevision::TYPECONST);
if (!$deps) {
echo "-\n";
continue;
}
$editor = new PhabricatorEdgeEditor();
foreach ($deps as $dep) {
$editor->addEdge(
$rev->getPHID(),
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV,
$dep);
}
$editor->save();
echo "OKAY\n";
}
$table->saveTransaction();
echo "Done.\n";