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