mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
a55c4a651e
Summary: Fixes T8375. This column is `repositoryID`, not `repository`. Test Plan: Examined schema. Reviewers: joshuaspence, btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T8375 Differential Revision: https://secure.phabricator.com/D13097
29 lines
667 B
PHP
29 lines
667 B
PHP
<?php
|
|
|
|
$table = new PhabricatorRepositorySymbol();
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
$projects = queryfx_all(
|
|
$conn_w,
|
|
'SELECT * FROM %T',
|
|
'repository_arcanistproject');
|
|
|
|
foreach ($projects as $project) {
|
|
$repo = id(new PhabricatorRepositoryQuery())
|
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
|
->withIDs(array($project['repositoryID']))
|
|
->executeOne();
|
|
|
|
if (!$repo) {
|
|
continue;
|
|
}
|
|
|
|
echo pht("Migrating symbols for '%s' project...\n", $project['name']);
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET repositoryPHID = %s WHERE arcanistProjectID = %d',
|
|
$table->getTableName(),
|
|
$repo->getPHID(),
|
|
$project['id']);
|
|
}
|