Verschiedene Korrekturen an Updateskripten

git-svn-id: https://svn.libreccm.org/ccm/trunk@1775 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2012-07-18 18:04:11 +00:00
parent 72d0b12f6c
commit 4563939f50
7 changed files with 21 additions and 20 deletions

View File

@ -187,12 +187,12 @@ public abstract class AbstractAssocUpgrade {
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 ("

View File

@ -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)));

View File

@ -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) {

View File

@ -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

View File

@ -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";
}
}

View File

@ -22,13 +22,13 @@ public class PublicationAuthorsAssocUpgrade extends AbstractAssocUpgrade {
@Override
protected String getMemberIdCol() {
return "author_id";
return "person_id";
}
@Override
protected Map<String, String> getAttributes() {
final Map<String, String> attributes = new HashMap<String, String>();
attributes.put("editor", "BIT");
attributes.put("editor", "boolean");
attributes.put("authorship_order", "integer");
return attributes;
}

View File

@ -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);