1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00
phorge-phorge/resources/sql/patches/20130802.heraldphids.php

25 lines
516 B
PHP
Raw Normal View History

<?php
$table = new HeraldRule();
$conn_w = $table->establishConnection('w');
echo pht('Assigning PHIDs to Herald Rules...')."\n";
foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
$id = $rule->getID();
echo pht('Rule %d.', $id)."\n";
if ($rule->getPHID()) {
continue;
}
queryfx(
$conn_w,
'UPDATE %T SET phid = %s WHERE id = %d',
$table->getTableName(),
PhabricatorPHID::generateNewPHID(HeraldRulePHIDType::TYPECONST),
$rule->getID());
}
echo pht('Done.')."\n";