Repository: ambari Updated Branches: refs/heads/branch-2.4 f77b41582 -> 9976ef287
AMBARI-16939. 'ambari-server upgrade' is failed : Error executing schema upgrade [upgrade from 2200 to 2400] (Balázs Bence Sári via magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9976ef28 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9976ef28 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9976ef28 Branch: refs/heads/branch-2.4 Commit: 9976ef287f8f8369dde1e540f287cae6250e7330 Parents: f77b415 Author: Sandor Magyari <smagy...@hortonworks.com> Authored: Mon May 30 16:26:27 2016 +0200 Committer: Sandor Magyari <smagy...@hortonworks.com> Committed: Mon May 30 16:33:53 2016 +0200 ---------------------------------------------------------------------- .../java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9976ef28/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java index 408df4f..b817a15 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java @@ -1398,8 +1398,12 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog { } // drop FKs to SCDS in both HCDS and HCS tables + // These are the expected constraint names dbAccessor.dropFKConstraint(HOST_COMPONENT_DS_TABLE, "hstcmpnntdesiredstatecmpnntnme"); dbAccessor.dropFKConstraint(HOST_COMPONENT_STATE_TABLE, "hstcomponentstatecomponentname"); + // These are the old (pre Ambari 1.5) constraint names, however still found on some installations + dbAccessor.dropFKConstraint(HOST_COMPONENT_DS_TABLE, "FK_hostcomponentdesiredstate_component_name"); + dbAccessor.dropFKConstraint(HOST_COMPONENT_STATE_TABLE, "FK_hostcomponentstate_component_name"); // remove existing compound PK dbAccessor.dropPKConstraint(SERVICE_COMPONENT_DS_TABLE, "servicecomponentdesiredstate_pkey");