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