2015-05-03 02:11:17 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$table = new PhabricatorRepositorySymbol();
|
|
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
|
2015-06-01 07:35:13 +02:00
|
|
|
$projects = queryfx_all(
|
|
|
|
$conn_w,
|
|
|
|
'SELECT * FROM %T',
|
|
|
|
'repository_arcanistproject');
|
|
|
|
|
2015-05-03 02:11:17 +02:00
|
|
|
foreach ($projects as $project) {
|
2015-06-01 07:35:13 +02:00
|
|
|
$repo = id(new PhabricatorRepositoryQuery())
|
|
|
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
|
|
|
->withIDs(array($project['repository']))
|
|
|
|
->executeOne();
|
2015-05-03 02:11:17 +02:00
|
|
|
|
|
|
|
if (!$repo) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2015-06-01 07:35:13 +02:00
|
|
|
echo pht("Migrating symbols for '%s' project...\n", $project['name']);
|
2015-05-03 02:11:17 +02:00
|
|
|
|
|
|
|
queryfx(
|
|
|
|
$conn_w,
|
|
|
|
'UPDATE %T SET repositoryPHID = %s WHERE arcanistProjectID = %d',
|
|
|
|
$table->getTableName(),
|
|
|
|
$repo->getPHID(),
|
2015-06-01 07:35:13 +02:00
|
|
|
$project['id']);
|
2015-05-03 02:11:17 +02:00
|
|
|
}
|