mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
e10fdbe77e
Summary: Patches often read from slaves (possibly stale data) and use that information to write on master. It causes problems when applying more patches quickly after each other because data created in previous patch may not be replicated yet. Test Plan: $ bin/storage upgrade Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4483
29 lines
630 B
PHP
29 lines
630 B
PHP
<?php
|
|
|
|
echo "Migrating task revisions to edges...\n";
|
|
$table = new ManiphestTask();
|
|
$table->establishConnection('w');
|
|
|
|
foreach (new LiskMigrationIterator($table) as $task) {
|
|
$id = $task->getID();
|
|
echo "Task {$id}: ";
|
|
|
|
$revs = $task->getAttachedPHIDs(PhabricatorPHIDConstants::PHID_TYPE_DREV);
|
|
if (!$revs) {
|
|
echo "-\n";
|
|
continue;
|
|
}
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
$editor->setSuppressEvents(true);
|
|
foreach ($revs as $rev) {
|
|
$editor->addEdge(
|
|
$task->getPHID(),
|
|
PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV,
|
|
$rev);
|
|
}
|
|
$editor->save();
|
|
echo "OKAY\n";
|
|
}
|
|
|
|
echo "Done.\n";
|