From 4bbd2d52036c2bbe2ef50f7ca4e87e616cad25db Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 23 Apr 2014 14:22:02 -0700 Subject: [PATCH] Make an old migration a little more robust Summary: See https://github.com/facebook/phabricator/pull/507 Test Plan: This is hard to test since the migration no longer runs against HEAD, but pull 507 strongly implies this is the correct fix. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D8837 --- resources/sql/patches/20131004.dxreviewers.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/sql/patches/20131004.dxreviewers.php b/resources/sql/patches/20131004.dxreviewers.php index efe9daf5ab..3904613eb3 100644 --- a/resources/sql/patches/20131004.dxreviewers.php +++ b/resources/sql/patches/20131004.dxreviewers.php @@ -29,6 +29,13 @@ foreach (new LiskMigrationIterator($table) as $revision) { ->setActor(PhabricatorUser::getOmnipotentUser()); foreach ($reviewer_phids as $dst) { + if (phid_get_type($dst) == PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN) { + // At least one old install ran into some issues here. Skip the row if we + // can't figure out what the destination PHID is. See here: + // https://github.com/facebook/phabricator/pull/507 + continue; + } + $editor->addEdge( $revision_phid, PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER,