diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java index eabbac8e0..09d49f2ed 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractAssocUpgrade.java @@ -187,12 +187,12 @@ public abstract class AbstractAssocUpgrade { final StringBuilder attributeValues = new StringBuilder(); for (Map.Entry 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 (" diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java index 5f26ae9c7..3e85308eb 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java @@ -51,7 +51,7 @@ public abstract class AbstractBundleUpgrade { final Statement stmt = conn.createStatement(); stmt.addBatch(String.format("CREATE TABLE %s ( " - + "bundle_id integer NOT NULL)", + + "bundle_id integer NOT NULL);", getBundleTableName())); stmt.addBatch(String.format("ALTER TABLE ONLY %s " @@ -88,20 +88,21 @@ public abstract class AbstractBundleUpgrade { "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(), + + "VALUES (%d);", + getBundleTableName(), personsRs.getInt(1))); stmt.addBatch(String.format( "UPDATE acs_objects " + "SET default_domain_class = '%s'," + "object_type = '%s' " - + "WHERE object_id = %d", + + "WHERE object_id = %d;", getBundleClassName(), getBundleClassName(), personsRs.getInt(1))); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java index 34818c1a7..38b8b28f1 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/Upgrade664to665.java @@ -28,9 +28,9 @@ public class Upgrade664to665 extends Program { //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) { diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ArticleInCollectedVolumeBundleUpgrade.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ArticleInCollectedVolumeBundleUpgrade.java index 38809b3ce..0b174719c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ArticleInCollectedVolumeBundleUpgrade.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ArticleInCollectedVolumeBundleUpgrade.java @@ -31,7 +31,7 @@ public class ArticleInCollectedVolumeBundleUpgrade extends AbstractBundleUpgrade @Override protected String getPrimaryKeyConstraintName() { - return "ct_article_in_collected_volume_bundles"; + return "ct_art_in_col_vol_bun__p_1khsq"; } @Override diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ExpertiseOrdererAssocUpgrade.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ExpertiseOrdererAssocUpgrade.java index d72c0f44b..750f001a8 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ExpertiseOrdererAssocUpgrade.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/ExpertiseOrdererAssocUpgrade.java @@ -12,7 +12,7 @@ public class ExpertiseOrdererAssocUpgrade extends AbstractAssocUpgrade { @Override protected String getTableName() { - return "ct_expertise_orderer"; + return "ct_expertise_orderer_map"; } @Override @@ -54,7 +54,7 @@ public class ExpertiseOrdererAssocUpgrade extends AbstractAssocUpgrade { @Override protected String getMemberTableName() { - return "ct_orgaunit_bundles"; + return "cms_orgaunit_bundles"; } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/PublicationAuthorsAssocUpgrade.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/PublicationAuthorsAssocUpgrade.java index a7e3eb9d6..c6b6f2933 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/PublicationAuthorsAssocUpgrade.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/PublicationAuthorsAssocUpgrade.java @@ -22,13 +22,13 @@ public class PublicationAuthorsAssocUpgrade extends AbstractAssocUpgrade { @Override protected String getMemberIdCol() { - return "author_id"; + return "person_id"; } @Override protected Map getAttributes() { final Map attributes = new HashMap(); - attributes.put("editor", "BIT"); + attributes.put("editor", "boolean"); attributes.put("authorship_order", "integer"); return attributes; } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/SciPublicationsUpgrade662to663.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/SciPublicationsUpgrade662to663.java index 035693dde..957807aad 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/SciPublicationsUpgrade662to663.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/upgrades/SciPublicationsUpgrade662to663.java @@ -52,7 +52,7 @@ public class SciPublicationsUpgrade662to663 extends Program { XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/ArticleInCollectedVolume.xml", handler); XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/ArticleInJournal.xml", handler); XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/CollectedVolume.xml", handler); - XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/ExpertiseBundle", handler); + XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Expertise.xml", handler); XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/InProceedings.xml", handler); XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/InternetArticle.xml", handler); XML.parseResource("/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Journal.xml", handler);