Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140205.cal.3.phid-mig.php
| <?php | <?php | ||||
| $table = new PhabricatorCalendarEvent(); | $table = new PhabricatorCalendarEvent(); | ||||
| $conn_w = $table->establishConnection('w'); | $conn_w = $table->establishConnection('w'); | ||||
| echo "Assigning PHIDs to events...\n"; | echo pht('Assigning PHIDs to events...')."\n"; | ||||
| foreach (new LiskMigrationIterator($table) as $event) { | foreach (new LiskMigrationIterator($table) as $event) { | ||||
| $id = $event->getID(); | $id = $event->getID(); | ||||
| echo "Updating event {$id}...\n"; | echo pht('Updating event %d...', $id)."\n"; | ||||
| if ($event->getPHID()) { | if ($event->getPHID()) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'UPDATE %T SET phid = %s WHERE id = %d', | 'UPDATE %T SET phid = %s WHERE id = %d', | ||||
| $table->getTableName(), | $table->getTableName(), | ||||
| $table->generatePHID(), | $table->generatePHID(), | ||||
| $id); | $id); | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||