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