mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +01:00
2483f6f120
Summary: Fixes T7220. Ref T7977. Changes symbols from being bound to an Arcanist project to being bound to a repository. Test Plan: - Added symbols and then applied migrations, symbols seemed to be migrated successfully. - Tested the `/diffusion/symbol/$SYMBOL_NAME` endpoint. - Tested the `/diffusion/symbol/$SYMBOL_NAME` endpoint with the `?repositories=$REPOSITORY_PHID` parameter. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: avivey, Korvin, epriestley Maniphest Tasks: T7977, T7220 Differential Revision: https://secure.phabricator.com/D12608
26 lines
609 B
PHP
26 lines
609 B
PHP
<?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());
|
|
}
|