Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/patches/20131118.ownerorder.php
| <?php | <?php | ||||
| $table = new ManiphestTask(); | $table = new ManiphestTask(); | ||||
| $conn_w = $table->establishConnection('w'); | $conn_w = $table->establishConnection('w'); | ||||
| $user_table = new PhabricatorUser(); | $user_table = new PhabricatorUser(); | ||||
| $user_conn = $user_table->establishConnection('r'); | $user_conn = $user_table->establishConnection('r'); | ||||
| foreach (new LiskMigrationIterator($table) as $task) { | foreach (new LiskMigrationIterator($table) as $task) { | ||||
| $id = $task->getID(); | $id = $task->getID(); | ||||
| echo "Checking task T{$id}...\n"; | echo pht('Checking task %s...', "T{$id}")."\n"; | ||||
| $owner_phid = $task->getOwnerPHID(); | $owner_phid = $task->getOwnerPHID(); | ||||
| if (!$owner_phid && !$task->getOwnerOrdering()) { | if (!$owner_phid && !$task->getOwnerOrdering()) { | ||||
| // No owner and no ordering; we're all set. | // No owner and no ordering; we're all set. | ||||
| continue; | continue; | ||||
| } | } | ||||
| $owner_row = queryfx_one( | $owner_row = queryfx_one( | ||||
| Show All 13 Lines | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'UPDATE %T SET ownerOrdering = %ns WHERE id = %d', | 'UPDATE %T SET ownerOrdering = %ns WHERE id = %d', | ||||
| $table->getTableName(), | $table->getTableName(), | ||||
| $value, | $value, | ||||
| $task->getID()); | $task->getID()); | ||||
| } | } | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||