1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00
phorge-phorge/resources/sql/autopatches/20140904.macroattach.php

27 lines
543 B
PHP
Raw Normal View History

<?php
$table = new PhabricatorFileImageMacro();
foreach (new LiskMigrationIterator($table) as $macro) {
$name = $macro->getName();
echo "Linking macro '{$name}'...\n";
$editor = new PhabricatorEdgeEditor();
$phids[] = $macro->getFilePHID();
$phids[] = $macro->getAudioPHID();
$phids = array_filter($phids);
if ($phids) {
foreach ($phids as $phid) {
$editor->addEdge(
$macro->getPHID(),
PhabricatorObjectHasFileEdgeType::EDGECONST ,
$phid);
}
$editor->save();
}
}
echo "Done.\n";