Repository: ambari Updated Branches: refs/heads/trunk a79c98d48 -> baa8ae916
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/baa8ae91 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/baa8ae91 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/baa8ae91 Branch: refs/heads/trunk Commit: baa8ae9168d7bf14d37f157a6338f4e75aab15d0 Parents: a79c98d Author: Sandor Magyari <[email protected]> Authored: Mon May 30 16:26:27 2016 +0200 Committer: Sandor Magyari <[email protected]> Committed: Mon May 30 16:53: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/baa8ae91/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 0d483fc..852e10f 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");
