1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00
phorge-phorge/resources/sql/patches/20121209.xmacromigrate.php

24 lines
462 B
PHP
Raw Normal View History

<?php
echo pht('Giving image macros PHIDs');
$table = new PhabricatorFileImageMacro();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $macro) {
if ($macro->getPHID()) {
continue;
}
echo '.';
queryfx(
$macro->establishConnection('w'),
'UPDATE %T SET phid = %s WHERE id = %d',
$macro->getTableName(),
$macro->generatePHID(),
$macro->getID());
}
$table->saveTransaction();
echo "\n".pht('Done.')."\n";