From 5e710959bed93b75f239821b739e55d0b8a63122 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 26 Mar 2018 06:55:17 -0700 Subject: [PATCH] (stable) Drop uniqueness constraint on PushEvent request ID Summary: See . Mercurial may invoke hooks multiple times per push. Test Plan: Pushed to Mercurial, saw key constraint failure. Differential Revision: https://secure.phabricator.com/D19257 --- resources/sql/autopatches/20180326.lock.03.nonunique.sql | 2 ++ .../repository/storage/PhabricatorRepositoryPushEvent.php | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 resources/sql/autopatches/20180326.lock.03.nonunique.sql diff --git a/resources/sql/autopatches/20180326.lock.03.nonunique.sql b/resources/sql/autopatches/20180326.lock.03.nonunique.sql new file mode 100644 index 0000000000..9e12d7e864 --- /dev/null +++ b/resources/sql/autopatches/20180326.lock.03.nonunique.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_repository.repository_pushevent + DROP KEY `key_request`; diff --git a/src/applications/repository/storage/PhabricatorRepositoryPushEvent.php b/src/applications/repository/storage/PhabricatorRepositoryPushEvent.php index 451f8acda5..e44f99df4d 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryPushEvent.php +++ b/src/applications/repository/storage/PhabricatorRepositoryPushEvent.php @@ -46,9 +46,8 @@ final class PhabricatorRepositoryPushEvent 'key_repository' => array( 'columns' => array('repositoryPHID'), ), - 'key_request' => array( + 'key_identifier' => array( 'columns' => array('requestIdentifier'), - 'unique' => true, ), ), ) + parent::getConfiguration();