2013-08-02 15:11:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$table = new HeraldRule();
|
|
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Assigning PHIDs to Herald Rules...')."\n";
|
2013-08-02 15:11:25 +02:00
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
|
|
|
|
$id = $rule->getID();
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Rule %d.', $id)."\n";
|
2013-08-02 15:11:25 +02:00
|
|
|
|
|
|
|
if ($rule->getPHID()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
queryfx(
|
|
|
|
$conn_w,
|
|
|
|
'UPDATE %T SET phid = %s WHERE id = %d',
|
|
|
|
$table->getTableName(),
|
2014-07-24 00:05:46 +02:00
|
|
|
PhabricatorPHID::generateNewPHID(HeraldRulePHIDType::TYPECONST),
|
2013-08-02 15:11:25 +02:00
|
|
|
$rule->getID());
|
|
|
|
}
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|