1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-11 16:16:14 +01:00
phorge-phorge/resources/sql/patches/20121209.xmacromigrate.php

24 lines
446 B
PHP
Raw Normal View History

<?php
echo "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 "\nDone.\n";