1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +01:00
phorge-phorge/resources/sql/autopatches/20150503.repositorysymbols.2.php

27 lines
609 B
PHP
Raw Normal View History

<?php
$projects = id(new PhabricatorRepositoryArcanistProjectQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->needRepositories(true)
->execute();
$table = new PhabricatorRepositorySymbol();
$conn_w = $table->establishConnection('w');
foreach ($projects as $project) {
$repo = $project->getRepository();
if (!$repo) {
continue;
}
echo pht("Migrating symbols for '%s' project...\n", $project->getName());
queryfx(
$conn_w,
'UPDATE %T SET repositoryPHID = %s WHERE arcanistProjectID = %d',
$table->getTableName(),
$repo->getPHID(),
$project->getID());
}