@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Drop uniqueness constraint on PushEvent request ID

Summary: See <https://discourse.phabricator-community.org/t/pushing-to-mercurial-repository-fails/1275/1>. Mercurial may invoke hooks multiple times per push.

Test Plan: Pushed to Mercurial, saw key constraint failure.

Differential Revision: https://secure.phabricator.com/D19257

+3 -2
+2
resources/sql/autopatches/20180326.lock.03.nonunique.sql
··· 1 + ALTER TABLE {$NAMESPACE}_repository.repository_pushevent 2 + DROP KEY `key_request`;
+1 -2
src/applications/repository/storage/PhabricatorRepositoryPushEvent.php
··· 46 46 'key_repository' => array( 47 47 'columns' => array('repositoryPHID'), 48 48 ), 49 - 'key_request' => array( 49 + 'key_identifier' => array( 50 50 'columns' => array('requestIdentifier'), 51 - 'unique' => true, 52 51 ), 53 52 ), 54 53 ) + parent::getConfiguration();