Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/patches/131.migraterevisionquery.php
| <?php | <?php | ||||
| $table = new DifferentialRevision(); | $table = new DifferentialRevision(); | ||||
| $table->openTransaction(); | $table->openTransaction(); | ||||
| $table->beginReadLocking(); | $table->beginReadLocking(); | ||||
| $conn_w = $table->establishConnection('w'); | $conn_w = $table->establishConnection('w'); | ||||
| echo 'Migrating revisions'; | echo pht('Migrating revisions')."\n"; | ||||
| do { | do { | ||||
| $revisions = $table->loadAllWhere('branchName IS NULL LIMIT 1000'); | $revisions = $table->loadAllWhere('branchName IS NULL LIMIT 1000'); | ||||
| foreach ($revisions as $revision) { | foreach ($revisions as $revision) { | ||||
| echo '.'; | echo '.'; | ||||
| $diff = $revision->loadActiveDiff(); | $diff = $revision->loadActiveDiff(); | ||||
| if (!$diff) { | if (!$diff) { | ||||
| Show All 10 Lines | queryfx( | ||||
| $branch_name, | $branch_name, | ||||
| $arc_project_phid, | $arc_project_phid, | ||||
| $revision->getID()); | $revision->getID()); | ||||
| } | } | ||||
| } while (count($revisions) == 1000); | } while (count($revisions) == 1000); | ||||
| $table->endReadLocking(); | $table->endReadLocking(); | ||||
| $table->saveTransaction(); | $table->saveTransaction(); | ||||
| echo "\nDone.\n"; | echo "\n".pht('Done.')."\n"; | ||||