Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/patches/20130502.countdownrevamp2.php
| <?php | <?php | ||||
| echo 'Giving countdowns PHIDs'; | echo pht('Giving countdowns PHIDs'); | ||||
| $table = new PhabricatorCountdown(); | $table = new PhabricatorCountdown(); | ||||
| $table->openTransaction(); | $table->openTransaction(); | ||||
| foreach (new LiskMigrationIterator($table) as $countdown) { | foreach (new LiskMigrationIterator($table) as $countdown) { | ||||
| if ($countdown->getPHID()) { | if ($countdown->getPHID()) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| echo '.'; | echo '.'; | ||||
| queryfx( | queryfx( | ||||
| $countdown->establishConnection('w'), | $countdown->establishConnection('w'), | ||||
| 'UPDATE %T SET phid = %s WHERE id = %d', | 'UPDATE %T SET phid = %s WHERE id = %d', | ||||
| $countdown->getTableName(), | $countdown->getTableName(), | ||||
| $countdown->generatePHID(), | $countdown->generatePHID(), | ||||
| $countdown->getID()); | $countdown->getID()); | ||||
| } | } | ||||
| $table->saveTransaction(); | $table->saveTransaction(); | ||||
| echo "\nDone.\n"; | echo "\n".pht('Done.')."\n"; | ||||