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/20130409.commitdrev.php
epriestley 8cbfb49b4e Remove all edge events
Summary:
Ref T5245. These were a bad idea.

We no longer need actors for edge edits either, so remove those. Generally, edges have fit into the policy model as pure/low-level infrastructure, and they do not have any policy or capability information in and of themselves.

Test Plan: `grep`

Reviewers: chad, btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T5245

Differential Revision: https://secure.phabricator.com/D9840
2014-07-17 15:41:42 -07:00

33 lines
839 B
PHP

<?php
echo "Migrating differential.revisionPHID to edges...\n";
$commit_table = new PhabricatorRepositoryCommit();
$data_table = new PhabricatorRepositoryCommitData();
$editor = new PhabricatorEdgeEditor();
$commit_table->establishConnection('w');
$edges = 0;
foreach (new LiskMigrationIterator($commit_table) as $commit) {
$data = $commit->loadOneRelative($data_table, 'commitID');
if (!$data) {
continue;
}
$revision_phid = $data->getCommitDetail('differential.revisionPHID');
if (!$revision_phid) {
continue;
}
$commit_drev = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV;
$editor->addEdge($commit->getPHID(), $commit_drev, $revision_phid);
$edges++;
if ($edges % 256 == 0) {
echo '.';
$editor->save();
$editor = new PhabricatorEdgeEditor();
}
}
echo '.';
$editor->save();
echo "\nDone.\n";