Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/patches/20130409.commitdrev.php
| <?php | <?php | ||||
| echo "Migrating differential.revisionPHID to edges...\n"; | echo pht('Migrating %s to edges...', 'differential.revisionPHID')."\n"; | ||||
| $commit_table = new PhabricatorRepositoryCommit(); | $commit_table = new PhabricatorRepositoryCommit(); | ||||
| $data_table = new PhabricatorRepositoryCommitData(); | $data_table = new PhabricatorRepositoryCommitData(); | ||||
| $editor = new PhabricatorEdgeEditor(); | $editor = new PhabricatorEdgeEditor(); | ||||
| $commit_table->establishConnection('w'); | $commit_table->establishConnection('w'); | ||||
| $edges = 0; | $edges = 0; | ||||
| foreach (new LiskMigrationIterator($commit_table) as $commit) { | foreach (new LiskMigrationIterator($commit_table) as $commit) { | ||||
| $data = $commit->loadOneRelative($data_table, 'commitID'); | $data = $commit->loadOneRelative($data_table, 'commitID'); | ||||
| Show All 13 Lines | if ($edges % 256 == 0) { | ||||
| echo '.'; | echo '.'; | ||||
| $editor->save(); | $editor->save(); | ||||
| $editor = new PhabricatorEdgeEditor(); | $editor = new PhabricatorEdgeEditor(); | ||||
| } | } | ||||
| } | } | ||||
| echo '.'; | echo '.'; | ||||
| $editor->save(); | $editor->save(); | ||||
| echo "\nDone.\n"; | echo "\n".pht('Done.')."\n"; | ||||