Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20150501.calendar.2.reply.php
| <?php | <?php | ||||
| echo "Adding mailkeys to events.\n"; | echo pht('Adding %s to events.', 'mailkeys')."\n"; | ||||
| $table = new PhabricatorCalendarEvent(); | $table = new PhabricatorCalendarEvent(); | ||||
| $conn_w = $table->establishConnection('w'); | $conn_w = $table->establishConnection('w'); | ||||
| $iterator = new LiskMigrationIterator($table); | $iterator = new LiskMigrationIterator($table); | ||||
| foreach ($iterator as $event) { | foreach ($iterator as $event) { | ||||
| $id = $event->getID(); | $id = $event->getID(); | ||||
| echo "Populating event {$id}...\n"; | echo pht('Populating event %d...', $id)."\n"; | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'UPDATE %T SET mailKey = %s WHERE id = %d', | 'UPDATE %T SET mailKey = %s WHERE id = %d', | ||||
| $table->getTableName(), | $table->getTableName(), | ||||
| Filesystem::readRandomCharacters(20), | Filesystem::readRandomCharacters(20), | ||||
| $id); | $id); | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||