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 'Migrating revisions'; | ||||
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) { | ||||
continue; | continue; | ||||
} | } | ||||
$branch_name = $diff->getBranch(); | $branch_name = $diff->getBranch(); | ||||
$arc_project_phid = $diff->getArcanistProjectPHID(); | $arc_project_phid = $diff->getArcanistProjectPHID(); | ||||
Show All 14 Lines |