From: <pb...@fe...> - 2012-12-16 19:10:40
|
Author: pboy Date: 2012-12-16 19:10:33 +0000 (Sun, 16 Dec 2012) New Revision: 2385 Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java Log: Fixed upgrade scripts (backport part of r2378) (on behalf of JensP). Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java =================================================================== --- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java 2012-12-16 19:05:12 UTC (rev 2384) +++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java 2012-12-16 19:10:33 UTC (rev 2385) @@ -187,12 +187,12 @@ final StringBuilder attributeValues = new StringBuilder(); for (Map.Entry<String, String> attribute : getAttributes().entrySet()) { attributeValues.append(","); - if (attribute.getValue().startsWith("character")) { - attributeValues.append('\"'); + if (attribute.getValue().startsWith("character") || attribute.getValue().startsWith("BIT") || attribute.getValue().startsWith("boolean")) { + attributeValues.append('\''); } attributeValues.append(entry.getAttributes().get(attribute.getKey())); - if (attribute.getValue().startsWith("character")) { - attributeValues.append('\"'); + if (attribute.getValue().startsWith("character") || attribute.getValue().startsWith("BIT") || attribute.getValue().startsWith("boolean")) { + attributeValues.append('\''); } } stmt.addBatch(String.format("INSERT INTO %s (" Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java =================================================================== --- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java 2012-12-16 19:05:12 UTC (rev 2384) +++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java 2012-12-16 19:10:33 UTC (rev 2385) @@ -88,14 +88,15 @@ "SELECT parent_id " + "FROM cms_items " + "JOIN %s " - + "ON cms_items.item_id = %s.bundle_id", - getBundleTableName(), - getBundleTableName())); + + "ON cms_items.item_id = %s.%s;", + getContentItemTableName(), + getContentItemTableName(), + getIdColName())); while (personsRs.next()) { stmt.addBatch(String.format("INSERT INTO %s (bundle_id) " + "VALUES (%d)", - getBundleClassName(), + getBundleTableName(), personsRs.getInt(1))); stmt.addBatch(String.format( "UPDATE acs_objects " Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java =================================================================== --- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java 2012-12-16 19:05:12 UTC (rev 2384) +++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java 2012-12-16 19:10:33 UTC (rev 2385) @@ -28,9 +28,9 @@ //Reload authoring steps XMLContentTypeHandler handler = new XMLContentTypeHandler(); - XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/GenericContact.xml", handler); - XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.xml", handler); - XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/GenericPerson.xml", handler); + XML.parseResource("/WEB-INF/content-types/GenericContact.xml", handler); + XML.parseResource("/WEB-INF/content-types/GenericOrganizationalUnit.xml", handler); + XML.parseResource("/WEB-INF/content-types/GenericPerson.xml", handler); } public static void main(final String[] args) { |