2014-01-06 21:17:23 +01:00
|
|
|
<?php
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Adding mailkeys to macros.')."\n";
|
2014-01-06 21:17:23 +01:00
|
|
|
|
|
|
|
$table = new PhabricatorFileImageMacro();
|
|
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
$iterator = new LiskMigrationIterator($table);
|
|
|
|
foreach ($iterator as $macro) {
|
|
|
|
$id = $macro->getID();
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Populating macro %d...', $id)."\n";
|
2014-01-06 21:17:23 +01:00
|
|
|
|
|
|
|
if (!$macro->getMailKey()) {
|
|
|
|
queryfx(
|
|
|
|
$conn_w,
|
|
|
|
'UPDATE %T SET mailKey = %s WHERE id = %d',
|
|
|
|
$table->getTableName(),
|
|
|
|
Filesystem::readRandomCharacters(20),
|
|
|
|
$id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|