mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Fix inadvertent forward dependency in task owner migration
Summary: See <https://github.com/facebook/phabricator/issues/505>. When the status/event table moved, it broke this migration, which implicitly loads statuses by loading events. Instead, access just the row we care about. Test Plan: Used `--apply` to apply the new version of the patch. Reviewers: btrahan, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D8162
This commit is contained in:
parent
0cc1f50170
commit
b13a51adeb
1 changed files with 10 additions and 6 deletions
|
@ -3,6 +3,9 @@
|
|||
$table = new ManiphestTask();
|
||||
$conn_w = $table->establishConnection('w');
|
||||
|
||||
$user_table = new PhabricatorUser();
|
||||
$user_conn = $user_table->establishConnection('r');
|
||||
|
||||
foreach (new LiskMigrationIterator($table) as $task) {
|
||||
$id = $task->getID();
|
||||
|
||||
|
@ -14,13 +17,14 @@ foreach (new LiskMigrationIterator($table) as $task) {
|
|||
continue;
|
||||
}
|
||||
|
||||
$owner_handle = id(new PhabricatorHandleQuery())
|
||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||
->withPHIDs(array($owner_phid))
|
||||
->executeOne();
|
||||
$owner_row = queryfx_one(
|
||||
$user_conn,
|
||||
'SELECT * FROM %T WHERE phid = %s',
|
||||
$user_table->getTableName(),
|
||||
$owner_phid);
|
||||
|
||||
if ($owner_handle) {
|
||||
$value = $owner_handle->getName();
|
||||
if ($owner_row) {
|
||||
$value = $owner_row['userName'];
|
||||
} else {
|
||||
$value = null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue