From a369979f79491535efefce56aa38de593c8850e0 Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Sun, 17 May 2020 17:07:43 +0200 Subject: [PATCH] Refactor embedded localized string to JSON columns Former-commit-id: 5abbc454a2413ca414ead4d40e226fa29634da42 --- .../rs/ContentItemController.java | 104 ++ .../rs/ContentSectionsApplication.java | 1 + ...37__localized_string_embedded_to_json.java | 354 ++++++ .../org/libreccm/categorization/Category.java | 74 +- .../categorization/CategoryTreeModelLite.java | 7 +- .../org/libreccm/categorization/Domain.java | 33 +- .../configuration/LocalizedStringSetting.java | 23 +- .../main/java/org/libreccm/core/Resource.java | 33 +- .../java/org/libreccm/core/ResourceType.java | 21 +- .../org/libreccm/formbuilder/Component.java | 25 +- .../java/org/libreccm/formbuilder/Option.java | 21 +- .../formbuilder/PersistentDataQuery.java | 42 +- .../libreccm/formbuilder/ProcessListener.java | 40 +- .../hibernate/dialects/LibreCcmH2Dialect.java | 36 + .../dialects/LibreCcmPgSql9Dialect.java | 36 + .../org/libreccm/l10n/LocalizedString.java | 65 +- .../libreccm/l10n/LocalizedStringType.java | 155 +++ .../org/libreccm/pagemodel/PageModel.java | 37 +- .../main/java/org/libreccm/security/Role.java | 19 +- .../main/java/org/libreccm/workflow/Task.java | 34 +- .../java/org/libreccm/workflow/Workflow.java | 35 +- .../scripts/002_create_ccm_core_tables.sql | 1031 +++++++---------- .../scripts/002_create_ccm_core_tables.sql | 1029 +++++++--------- 23 files changed, 1781 insertions(+), 1474 deletions(-) create mode 100644 ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentItemController.java create mode 100644 ccm-core/src/main/java/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_37__localized_string_embedded_to_json.java create mode 100644 ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmH2Dialect.java create mode 100644 ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmPgSql9Dialect.java create mode 100644 ccm-core/src/main/java/org/libreccm/l10n/LocalizedStringType.java diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentItemController.java b/ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentItemController.java new file mode 100644 index 000000000..0107fd484 --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentItemController.java @@ -0,0 +1,104 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.librecms.contentsection.rs; + +import org.librecms.contentsection.ContentItem; +import org.librecms.contentsection.ContentItemRepository; +import org.librecms.contentsection.ContentSection; +import org.librecms.contentsection.ContentSectionRepository; +import org.librecms.contentsection.Folder; +import org.librecms.contentsection.FolderRepository; + +import java.util.Optional; + +import javax.inject.Inject; +import javax.transaction.Transactional; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Response; + +import static javax.ws.rs.core.MediaType.*; + +/** + * + * @author Jens Pelzetter + */ +@Path("/{content-section}/items/{path: .*}") +public class ContentItemController { + + @Inject + private FolderRepository folderRepo; + + @Inject + private ContentItemRepository itemRepo; + + @Inject + private ContentSectionRepository sectionRepo; + + @GET + @Path("/") + @Produces(APPLICATION_JSON) + @Transactional(Transactional.TxType.REQUIRED) + public ContentItem getContentItem( + @PathParam("content-section") final String sectionName, + @PathParam("path") final String path + ) { + final String[] pathTokens = path.split("/"); + + final ContentSection section = sectionRepo + .findByLabel(sectionName) + .orElseThrow( + () -> new WebApplicationException( + String.format( + "ContentSection \"%s\" does not exist.", + sectionName), + Response.Status.NOT_FOUND + ) + ); + + final Folder rootFolder = section.getRootDocumentsFolder(); + final StringBuilder folderPathBuilder = new StringBuilder("/"); + Folder folder = rootFolder; + for (int i = 0; i < pathTokens.length - 1; i++) { + final String pathToken = pathTokens[i]; + folderPathBuilder.append(pathToken); + final Optional result = folder + .getSubFolders() + .stream() + .filter(subFolder -> subFolder.getName().equals(pathToken)) + .findAny(); + if (result.isPresent()) { + folder = result.get(); + } else { + throw new WebApplicationException( + String.format( + "Folder %s not found in ContentSection %s.", + folderPathBuilder.toString(), + sectionName + ) + ); + } + } + + final String itemName = pathTokens[pathTokens.length - 1]; + final ContentItem item = itemRepo + .findByNameInFolder(folder, itemName) + .orElseThrow( + () -> new WebApplicationException( + String.format( + "No ContentItem %s in folder %s of ContentSection %s.", + itemName, + folderPathBuilder.toString() + ), + Response.Status.NOT_FOUND + ) + ); + return item; + } +} \ No newline at end of file diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentSectionsApplication.java b/ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentSectionsApplication.java index efe43a9bd..c3cdfa365 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentSectionsApplication.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/rs/ContentSectionsApplication.java @@ -38,6 +38,7 @@ public class ContentSectionsApplication extends Application{ classes.add(Assets.class); classes.add(ContentItems.class); + classes.add(ContentItemController.class); classes.add(ContentSections.class); classes.add(Images.class); diff --git a/ccm-core/src/main/java/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_37__localized_string_embedded_to_json.java b/ccm-core/src/main/java/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_37__localized_string_embedded_to_json.java new file mode 100644 index 000000000..bc05107d3 --- /dev/null +++ b/ccm-core/src/main/java/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_37__localized_string_embedded_to_json.java @@ -0,0 +1,354 @@ +/* + * Copyright (C) 2020 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package db.migrations.org.libreccm.ccm_core.pgsql; + +import org.flywaydb.core.api.migration.BaseJavaMigration; +import org.flywaydb.core.api.migration.Context; + +import java.io.StringWriter; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.List; + +import javax.json.Json; +import javax.json.JsonObjectBuilder; +import javax.json.JsonWriter; + +/** + * + * @author Jens Pelzetter + */ +public class V7_0_0_37__localized_string_embedded_to_json extends BaseJavaMigration { + + private static final String[] ADD_COLUMN_STATEMENTS = new String[]{ + "alter table CCM_CORE.CATEGORIES add column TITLE jsonb", + "alter table CCM_CORE.CATEGORIES add column DESCRIPTION jsonb", + "alter table CCM_CORE.CATEGORY_DOMAINS add column DESCRIPTION jsonb", + "alter table CCM_CORE.CATEGORY_DOMAINS add column TITLE jsonb", + "alter table CCM_ROLES add column DESCRIPTION jsonb", + "alter table CCM_CORE.FORMBUILDER_COMPONENTS add column DESCRIPTION jsonb", + "alter table CCM_CORE.FORMBUILDER_DATA_QUERIES add column DESCRIPTION jsonb", + "alter table CCM_CORE.FORMBUILDER_DATA_QUERIES add column QUERY_NAME jsonb", + "alter table CCM_CORE.FORMBUILDER_OPTIONS add column LABEL jsonb", + "alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS add column DESCRIPTION jsonb", + "alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS add column LISTENER_NAME jsonb", + "alter table CCM_CORE.PAGE_MODELS add column DESCRIPTION jsonb", + "alter table CCM_CORE.PAGE_MODELS add column TITLE jsonb", + "alter table CCM_CORE.RESOURCE_TYPES add column DESCRIPTION jsonb", + "alter table CCM_CORE.RESOURCES add column DESCRIPTION jsonb", + "alter table CCM_CORE.RESOURCES add column TITLE jsonb", + "alter table CCM_CORE.SETTINGS add column SETTING_VALUE_LOCALIZED_STRING jsonb", + "alter table CCM_CORE.WORKFLOW_TASKS add column DESCRIPTION jsonb", + "alter table CCM_CORE.WORKFLOW_TASKS add column LABEL jsonb", + "alter table CCM_CORE.WORKFLOWS add column DESCRIPTION jsonb", + "alter table CCM_CORE.WORKFLOWS add column NAME jsonb" + }; + + private static final int OBJECT_TABLE = 0; + + private static final int LOCALIZED_STR_TABLE = 1; + + private static final int OBJECT_ID_COL = 2; + + private static final int VALUE_ID_COL = 3; + + private static final int TARGET_COL = 4; + + private static final String[][] MIGRATE = new String[][]{ + new String[]{ + "CCM_CORE.CATEGORIES", + "CCM_CORE.CATEGORY_TITLES", + "OBJECT_ID", + "OBJECT_ID", + "TITLE" + }, + new String[]{ + "CCM_CORE.CATEGORIES", + "CCM_CORE.CATEGORY_DESCRIPTIONS", + "OBJECT_ID", + "OBJECT_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.CATEGORY_DOMAINS", + "CCM_CORE.DOMAIN_TITLES", + "OBJECT_ID", + "OBJECT_ID", + "TITLE" + }, + new String[]{ + "CCM_CORE.CATEGORY_DOMAINS", + "CCM_CORE.DOMAIN_DESCRIPTIONS", + "OBJECT_ID", + "OBJECT_ID", + "DESCRIPTIONS" + }, + new String[]{ + "CCM_CORE.CCM_ROLES", + "CCM_CORE.ROLE_DESCRIPTIONS", + "ROLE_ID", + "ROLE_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.FORMBUILDER_COMPONENTS", + "CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS", + "OBJECT_ID", + "OBJECT_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.FORMBUILDER_DATA_QUERIES", + "FORMBUILDER_DATA_QUERY_DESCRIPTIONS", + "OBJECT_ID", + "OBJECT_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.FORMBUILDER_DATA_QUERIES", + "FORMBUILDER_DATA_QUERY_NAMES", + "OBJECT_ID", + "OBJECT_ID", + "QUERY_NAME" + }, + new String[]{ + "CCM_CORE.FORMBUILDER_OPTIONS", + "FORMBUILDER_OPTION_LABELS", + "OBJECT_ID", + "OBJECT_ID", + "LABEL" + }, + new String[]{ + "CCM_CORE.FORMBUILDER_PROCESS_LISTENERS", + "FORMBUILDER_LISTENER_DESCRIPTIONS", + "OBJECT_ID", + "OBJECT_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.FORMBUILDER_PROCESS_LISTENERS", + "FORMBUILDER_LISTENER_NAMES", + "OBJECT_ID", + "OBJECT_ID", + "LISTENER_NAME" + }, + new String[]{ + "CCM_CORE.PAGE_MODELS", + "CCM_CORE.PAGE_MODEL_DESCRIPTIONS", + "PAGE_MODEL_ID", + "PAGE_MODEL_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.PAGE_MODELS", + "CCM_CORE.PAGE_MODEL_TITLES", + "PAGE_MODEL_ID", + "PAGE_MODEL_ID", + "TITLE" + }, + new String[]{ + "CCM_CORE.RESOURCE_TYPES", + "CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS", + "RESOURCE_TYPE_ID", + "RESOURCE_TYPE_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.RESOURCES", + "CCM_CORE.RESOURCE_DESCRIPTIONS", + "OBJECT_ID", "OBJECT_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.RESOURCES", + "CCM_CORE.RESOURCE_TITLES", + "OBJECT_ID", + "OBJECT_ID", + "TITLE" + }, + new String[]{ + "CCM_CORE.SETTINGS", + "CCM_CORE.SETTINGS_L10N_STR_VALUES", + "SETTING_ID", + "ENTRY_ID", + "SETTING_VALUE_LOCALIZED_STRING" + }, + new String[]{ + "CCM_CORE.WORKFLOW_TASKS", + "CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS", + "TASK_ID", + "TASK_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.WORKFLOW_TASKS", + "CCM_CORE.WORKFLOW_TASK_LABELS", + "TASK_ID", + "TASK_ID", + "LABEL" + }, + new String[]{ + "CCM_CORE.WORKFLOWS", + "CCM_CORE.WORKFLOW_DESCRIPTIONS", + "WORKFLOW_ID", + "WORKFLOW_ID", + "DESCRIPTION" + }, + new String[]{ + "CCM_CORE.WORKFLOWS", + "CCM_CORE.WORKFLOW_NAMES", + "WORKFLOW_ID", + "WORKFLOW_ID", + "NAME" + } + }; + + private static final String SELECT_IDS_QUERY_TEMPLATE = "select %s from %s"; + + private static final String SELECT_VALUES_QUERY_TEMPLATE + = "select locale, localized_value from %s where %s = ?"; + + private static final String SET_VALUES_QUERY_TEMPLATE + = "update %s set %s = ? where %s = ?"; + + private static final String[] DROP_TABLES = new String[]{ + "CCM_CORE.CATEGORY_TITLES", + "CCM_CORE.CATEGORY_DESCRIPTIONS", + "CCM_CORE.DOMAIN_TITLES", + "CCM_CORE.DOMAIN_DESCRIPTIONS", + "CCM_CORE.ROLE_DESCRIPTIONS", + "CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS", + "FORMBUILDER_DATA_QUERY_DESCRIPTIONS", + "FORMBUILDER_DATA_QUERY_NAMES", + "FORMBUILDER_OPTION_LABELS", + "FORMBUILDER_LISTENER_DESCRIPTIONS", + "FORMBUILDER_LISTENER_NAMES", + "CCM_CORE.PAGE_MODEL_DESCRIPTIONS", + "CCM_CORE.PAGE_MODEL_TITLES", + "CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS", + "CCM_CORE.RESOURCE_DESCRIPTIONS", + "CCM_CORE.RESOURCE_TITLES", + "CCM_CORE.SETTINGS_L10N_STR_VALUES", + "CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS", + "CCM_CORE.WORKFLOW_TASK_LABELS", + "CCM_CORE.WORKFLOW_DESCRIPTIONS", + "CCM_CORE.WORKFLOW_NAMES",}; + + private static final String DROP_TABLES_QUERY_TEMPLATE = "drop table %s"; + + @Override + public void migrate(final Context context) throws Exception { + final Connection connection = context.getConnection(); + + // Add columns for localized strings + for (final String addColStatement : ADD_COLUMN_STATEMENTS) { + try (PreparedStatement statement = connection.prepareStatement( + addColStatement + )) { + statement.execute(); + } + } + + for (final String[] migrate : MIGRATE) { + final String objectTable = migrate[OBJECT_TABLE]; + final String localizedStringTable = migrate[LOCALIZED_STR_TABLE]; + final String objectIdCol = migrate[OBJECT_ID_COL]; + final String valueIdCol = migrate[VALUE_ID_COL]; + final String targetCol = migrate[TARGET_COL]; + + final List objectIds = new ArrayList<>(); + final String selectIdsQuerySql = String.format( + SELECT_IDS_QUERY_TEMPLATE, + objectIdCol, + objectTable + ); + try (PreparedStatement stmt = connection.prepareStatement( + selectIdsQuerySql + ); + ResultSet resultSet = stmt.executeQuery()) { + while (resultSet.next()) { + objectIds.add(resultSet.getLong(objectIdCol)); + } + } + + final String valuesQuerySql = String.format( + SELECT_VALUES_QUERY_TEMPLATE, + localizedStringTable, + valueIdCol + ); + final String setValuesQuerySql = String.format( + SET_VALUES_QUERY_TEMPLATE, + objectTable, + targetCol, + objectIdCol + ); + try (PreparedStatement selectValuesStmt = connection + .prepareStatement(valuesQuerySql); + PreparedStatement setValuesStmt = connection.prepareStatement( + setValuesQuerySql + )) { + for (final Long objectId : objectIds) { + selectValuesStmt.setLong(1, objectId); + final JsonObjectBuilder jsonObjBuilder = Json + .createObjectBuilder(); + try (ResultSet resultSet = selectValuesStmt.executeQuery()) { + while (resultSet.next()) { + final String locale = resultSet.getString( + "locale" + ); + final String localizedValue = resultSet.getString( + "localizedValue" + ); + jsonObjBuilder.add(locale, localizedValue); + } + } + + try (StringWriter strWriter = new StringWriter(); + JsonWriter jsonWriter = Json.createWriter(strWriter)) { + jsonWriter.writeObject(jsonObjBuilder.build()); + setValuesStmt.setString(1, strWriter.toString()); + } + setValuesStmt.setLong(2, objectId); + setValuesStmt.execute(); + + setValuesStmt.clearParameters(); + selectValuesStmt.clearParameters(); + } + + } + + for (final String dropTable : DROP_TABLES) { + try(PreparedStatement stmt = connection.prepareStatement( + String.format(DROP_TABLES_QUERY_TEMPLATE, dropTable) + )) { + stmt.execute(); + } + } + + // SELECT object_id FROM ... order by object_id; + // for all object_id SELECT locale, localized_value FROM ... WHERE object_id = :object_id + // build json + // INSERT INTO ... WHERE object_id = :object_id + // Drop tables + } + + } +} \ No newline at end of file diff --git a/ccm-core/src/main/java/org/libreccm/categorization/Category.java b/ccm-core/src/main/java/org/libreccm/categorization/Category.java index 713e6b7b7..18bbe8b99 100644 --- a/ccm-core/src/main/java/org/libreccm/categorization/Category.java +++ b/ccm-core/src/main/java/org/libreccm/categorization/Category.java @@ -40,6 +40,7 @@ import java.util.Objects; import static org.libreccm.categorization.CategorizationConstants.CAT_XML_NS; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; import org.libreccm.imexport.Exportable; import javax.persistence.AssociationOverride; @@ -77,59 +78,48 @@ import javax.persistence.Table; @NamedQueries({ @NamedQuery( name = "Category.topLevelCategories", - query = "SELECT c FROM Category c WHERE c.parentCategory IS NULL") - , + query = "SELECT c FROM Category c WHERE c.parentCategory IS NULL"), @NamedQuery( name = "Category.findByName", - query = "SELECT c FROM Category c WHERE c.name = :name") - , + query = "SELECT c FROM Category c WHERE c.name = :name"), @NamedQuery( name = "Category.findByUuid", - query = "SELECT c FROM Category c WHERE c.uuid = :uuid") - , + query = "SELECT c FROM Category c WHERE c.uuid = :uuid"), @NamedQuery( name = "Category.findParentCategory", - query = "SELECT c.parentCategory FROM Category c WHERE c = :category") - , + query = "SELECT c.parentCategory FROM Category c WHERE c = :category"), @NamedQuery( name = "Category.countAssignedCategories", query = "SELECT COUNT(c) FROM Categorization c " + "WHERE c.categorizedObject = :object" - ) - , + ), @NamedQuery( name = "Category.isCategorized", query = "SELECT (CASE WHEN COUNT(c) > 0 THEN true ELSE false END) " + "FROM Categorization c " - + "WHERE c.categorizedObject = :object") - , + + "WHERE c.categorizedObject = :object"), @NamedQuery( name = "Category.countObjects", query = "SELECT COUNT(c) FROM Categorization c " - + "WHERE c.category = :category") - , + + "WHERE c.category = :category"), @NamedQuery( name = "Category.hasObjects", query = "SELECT (CASE WHEN COUNT(c) > 0 THEN true ELSE false END) " + "FROM Categorization c " - + "WHERE c.category = :category") - , + + "WHERE c.category = :category"), @NamedQuery( name = "Category.countSubCategories", query = "SELECT COUNT(c) FROM Category c " - + "WHERE c.parentCategory =:category") - , + + "WHERE c.parentCategory =:category"), @NamedQuery( name = "Category.hasSubCategories", query = "SELECT (CASE WHEN COUNT(c) > 0 THEN true ELSE false END) " + "FROM Category c " - + "WHERE c.parentCategory = :category") - , + + "WHERE c.parentCategory = :category"), @NamedQuery( name = "Category.findByNameAndParent", query = "SELECT c FROM Category c " - + "WHERE c.name = :name AND c.parentCategory = :parent") - , + + "WHERE c.name = :name AND c.parentCategory = :parent"), @NamedQuery( name = "Category.hasSubCategoryWithName", query = "SELECT (CASE WHEN COUNT(c) > 0 THEN true ELSE False END) " @@ -174,28 +164,32 @@ public class Category extends CcmObject implements Serializable, Exportable { /** * The human readable and localisable title of the category. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "CATEGORY_TITLES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "OBJECT_ID")} - )) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "CATEGORY_TITLES", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "OBJECT_ID")} +// )) + @Column(name = "TITLE") + @Type(type = "org.libreccm.l10n.LocalizedStringType") @XmlElement(name = "title", namespace = CAT_XML_NS) private LocalizedString title; /** * A localisable description of the category. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "CATEGORY_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "OBJECT_ID")} - )) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "CATEGORY_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "OBJECT_ID")} +// )) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") @XmlElement(name = "description", namespace = CAT_XML_NS) private LocalizedString description; @@ -469,14 +463,14 @@ public class Category extends CcmObject implements Serializable, Exportable { public String toString(final String data) { return super.toString(String.format(", uniqueId = %s, " + "name = \"%s\", " -// + "title = %s, " + // + "title = %s, " + "enabled = %b, " + "visible = %b, " + "abstractCategory = %s, " + "categoryOrder = %d%s", uniqueId, name, -// Objects.toString(title), + // Objects.toString(title), enabled, visible, abstractCategory, diff --git a/ccm-core/src/main/java/org/libreccm/categorization/CategoryTreeModelLite.java b/ccm-core/src/main/java/org/libreccm/categorization/CategoryTreeModelLite.java index 2b18331ef..8418c2c51 100755 --- a/ccm-core/src/main/java/org/libreccm/categorization/CategoryTreeModelLite.java +++ b/ccm-core/src/main/java/org/libreccm/categorization/CategoryTreeModelLite.java @@ -142,9 +142,10 @@ public class CategoryTreeModelLite implements TreeModel { return category.getName(); } else { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); - final CategoryTreeModelLiteController controller = cdiUtil - .findBean(CategoryTreeModelLiteController.class); - return controller.getTitle(category); + final GlobalizationHelper globalizationHelper = cdiUtil + .findBean(GlobalizationHelper.class); + return globalizationHelper + .getValueFromLocalizedString(category.getTitle()); } } diff --git a/ccm-core/src/main/java/org/libreccm/categorization/Domain.java b/ccm-core/src/main/java/org/libreccm/categorization/Domain.java index dcb3a5e36..ad8756516 100644 --- a/ccm-core/src/main/java/org/libreccm/categorization/Domain.java +++ b/ccm-core/src/main/java/org/libreccm/categorization/Domain.java @@ -40,6 +40,7 @@ import java.io.Serializable; import static org.libreccm.categorization.CategorizationConstants.CAT_XML_NS; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; import org.libreccm.imexport.Exportable; import java.util.ArrayList; @@ -160,26 +161,30 @@ public class Domain extends CcmObject implements Serializable, Exportable { * A human readable title for the {@code Domain}. The title can be * localised. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "DOMAIN_TITLES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "OBJECT_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "DOMAIN_TITLES", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "OBJECT_ID")})) + @Column(name = "TITLE") + @Type(type = "org.libreccm.l10n.LocalizedStringType") @XmlElement(name = "title", namespace = CAT_XML_NS) private LocalizedString title; /** * A description of the domain. The description can be localised. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "DOMAIN_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "OBJECT_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "DOMAIN_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "OBJECT_ID")})) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") @XmlElement(name = "description", namespace = CAT_XML_NS) private LocalizedString description; diff --git a/ccm-core/src/main/java/org/libreccm/configuration/LocalizedStringSetting.java b/ccm-core/src/main/java/org/libreccm/configuration/LocalizedStringSetting.java index 5a40dbcb5..060c91010 100644 --- a/ccm-core/src/main/java/org/libreccm/configuration/LocalizedStringSetting.java +++ b/ccm-core/src/main/java/org/libreccm/configuration/LocalizedStringSetting.java @@ -23,13 +23,10 @@ import org.libreccm.l10n.LocalizedString; import java.io.Serializable; import java.util.Objects; -import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; -import javax.persistence.AssociationOverride; -import javax.persistence.Embedded; +import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; /** * A setting which stores a {@link LocalizedString} . This can be used for @@ -44,13 +41,15 @@ public class LocalizedStringSetting private static final long serialVersionUID = 667750736151545279L; - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "SETTINGS_L10N_STR_VALUES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "ENTRY_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "SETTINGS_L10N_STR_VALUES", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "ENTRY_ID")})) + @Column(name = "SETTING_VALUE_LOCALIZED_STRING") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString value; public LocalizedStringSetting() { diff --git a/ccm-core/src/main/java/org/libreccm/core/Resource.java b/ccm-core/src/main/java/org/libreccm/core/Resource.java index b3ae044e5..fabd25e3e 100644 --- a/ccm-core/src/main/java/org/libreccm/core/Resource.java +++ b/ccm-core/src/main/java/org/libreccm/core/Resource.java @@ -29,6 +29,7 @@ import java.io.Serializable; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; import org.libreccm.imexport.Exportable; import java.util.ArrayList; @@ -82,25 +83,29 @@ public class Resource extends CcmObject implements Serializable, Exportable { /** * A localisable title for the {@code Resource}. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "RESOURCE_TITLES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "OBJECT_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "RESOURCE_TITLES", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "OBJECT_ID")})) + @Column(name = "TITLE") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString title; /** * A localisable description for the {@code Resource}. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "RESOURCE_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "OBJECT_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "RESOURCE_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "OBJECT_ID")})) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description; @ManyToOne diff --git a/ccm-core/src/main/java/org/libreccm/core/ResourceType.java b/ccm-core/src/main/java/org/libreccm/core/ResourceType.java index 5cd73bc91..077a22f20 100644 --- a/ccm-core/src/main/java/org/libreccm/core/ResourceType.java +++ b/ccm-core/src/main/java/org/libreccm/core/ResourceType.java @@ -27,17 +27,14 @@ import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; import org.libreccm.imexport.Exportable; -import javax.persistence.AssociationOverride; import javax.persistence.Column; -import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; @@ -87,13 +84,15 @@ public class ResourceType implements Serializable, Exportable { @Column(name = "TITLE", length = 254, nullable = false) private String title; - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "RESOURCE_TYPE_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "RESOURCE_TYPE_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "RESOURCE_TYPE_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "RESOURCE_TYPE_ID")})) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description; @Column(name = "WORKSPACE_APP") diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/Component.java b/ccm-core/src/main/java/org/libreccm/formbuilder/Component.java index 17f9fbec7..9204c3d02 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/Component.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/Component.java @@ -21,7 +21,6 @@ package org.libreccm.formbuilder; import org.libreccm.core.CcmObject; import org.libreccm.l10n.LocalizedString; -import javax.persistence.*; import java.io.Serializable; import java.util.Collections; import java.util.List; @@ -29,6 +28,14 @@ import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + /** * * @author Jens Pelzetter @@ -46,13 +53,15 @@ public class Component extends CcmObject implements Serializable { @Column(name = "ADMIN_NAME") private String adminName; - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "FORMBUILDER_COMPONENT_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "COMPONENT_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "FORMBUILDER_COMPONENT_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "COMPONENT_ID")})) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description; @Column(name = "ATTRIBUTE_STRING") diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/Option.java b/ccm-core/src/main/java/org/libreccm/formbuilder/Option.java index 6312f5d32..1c8da2ed2 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/Option.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/Option.java @@ -20,12 +20,17 @@ package org.libreccm.formbuilder; import org.libreccm.l10n.LocalizedString; -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + /** * * @author Jens Pelzetter @@ -39,12 +44,14 @@ public class Option extends Component implements Serializable { @Column(name = "PARAMETER_VALUE") private String parameterValue; - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "FORMBUILDER_OPTION_LABELS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "OPTION_ID")})) +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "FORMBUILDER_OPTION_LABELS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "OPTION_ID")})) + @Column(name = "LABEL") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString label; public String getParameterValue() { diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/PersistentDataQuery.java b/ccm-core/src/main/java/org/libreccm/formbuilder/PersistentDataQuery.java index 4d7d1ec02..e33867101 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/PersistentDataQuery.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/PersistentDataQuery.java @@ -21,12 +21,20 @@ package org.libreccm.formbuilder; import org.libreccm.core.CcmObject; import org.libreccm.l10n.LocalizedString; -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; + +import javax.persistence.AssociationOverride; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.Table; + /** * * @author Jens Pelzetter @@ -40,22 +48,26 @@ public class PersistentDataQuery extends CcmObject implements Serializable { @Column(name = "QUERY_ID") private String queryId; - @AssociationOverride( - name = "values", - joinTable = @JoinTable( - name = "FORMBUILDER_DATA_QUERY_NAMES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "DATA_QUERY_ID")})) +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable( +// name = "FORMBUILDER_DATA_QUERY_NAMES", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "DATA_QUERY_ID")})) + @Column(name = "QUERY_NAME") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString name; - @AssociationOverride( - name = "values", - joinTable = @JoinTable( - name = "FORMBUILDER_DATA_QUERY_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "DATA_QUERY_ID")})) +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable( +// name = "FORMBUILDER_DATA_QUERY_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "DATA_QUERY_ID")})) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description; public PersistentDataQuery() { diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/ProcessListener.java b/ccm-core/src/main/java/org/libreccm/formbuilder/ProcessListener.java index 89c99999c..4a00562c8 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/ProcessListener.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/ProcessListener.java @@ -26,11 +26,10 @@ import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; -import javax.persistence.AssociationOverride; +import org.hibernate.annotations.Type; + import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -44,23 +43,26 @@ public class ProcessListener extends CcmObject implements Serializable { private static final long serialVersionUID = -3029184333026605708L; - @AssociationOverride( - name = "values", - joinTable = @JoinTable( - name = "FORMBUILDER_PROCESS_LISTENER_NAMES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "PROCESS_LISTENER_ID")})) +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable( +// name = "FORMBUILDER_PROCESS_LISTENER_NAMES", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "PROCESS_LISTENER_ID")})) + @Column(name = "LISTENER_NAME") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString name; - @AssociationOverride( - name = "values", - joinTable = @JoinTable( - name = "FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "PROCESS_LISTENER_ID")})) - +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable( +// name = "FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "PROCESS_LISTENER_ID")})) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description; @Column(name = "LISTENER_CLASS") @@ -77,7 +79,7 @@ public class ProcessListener extends CcmObject implements Serializable { name = new LocalizedString(); description = new LocalizedString(); } - + public LocalizedString getName() { return name; } diff --git a/ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmH2Dialect.java b/ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmH2Dialect.java new file mode 100644 index 000000000..2705bb3b6 --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmH2Dialect.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2020 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.libreccm.hibernate.dialects; + +import org.hibernate.dialect.H2Dialect; + +import java.sql.Types; + +/** + * + * @author Jens Pelzetter + */ +public class LibreCcmH2Dialect extends H2Dialect { + + public LibreCcmH2Dialect() { + super(); + super.registerColumnType(Types.JAVA_OBJECT, "json"); + } + +} diff --git a/ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmPgSql9Dialect.java b/ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmPgSql9Dialect.java new file mode 100644 index 000000000..ec4e182ce --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/hibernate/dialects/LibreCcmPgSql9Dialect.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2020 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.libreccm.hibernate.dialects; + +import org.hibernate.dialect.PostgreSQL9Dialect; + +import java.sql.Types; + +/** + * + * @author Jens Pelzetter + */ +public class LibreCcmPgSql9Dialect extends PostgreSQL9Dialect { + + public LibreCcmPgSql9Dialect() { + super(); + super.registerColumnType(Types.JAVA_OBJECT, "jsonb"); + } + +} diff --git a/ccm-core/src/main/java/org/libreccm/l10n/LocalizedString.java b/ccm-core/src/main/java/org/libreccm/l10n/LocalizedString.java index 79056815a..cd0e96947 100644 --- a/ccm-core/src/main/java/org/libreccm/l10n/LocalizedString.java +++ b/ccm-core/src/main/java/org/libreccm/l10n/LocalizedString.java @@ -19,22 +19,14 @@ package org.libreccm.l10n; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.hibernate.annotations.Type; -import org.hibernate.search.annotations.Field; import org.libreccm.l10n.jaxb.LocalizedStringValuesAdapter; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.ElementCollection; -import javax.persistence.Embeddable; -import javax.persistence.FetchType; -import javax.persistence.Lob; -import javax.persistence.MapKeyColumn; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + import java.io.Serializable; import java.util.Collections; import java.util.HashMap; @@ -45,6 +37,10 @@ import java.util.Set; import static org.libreccm.l10n.L10NConstants.L10N_XML_NS; +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; + /** * A helper class for localisable string properties. This class is declared as * embeddable, so that it can be used in every other entity. The localised @@ -53,7 +49,7 @@ import static org.libreccm.l10n.L10NConstants.L10N_XML_NS; * * @author Jens Pelzetter */ -@Embeddable +//@Embeddable @XmlRootElement(name = "localized-string", namespace = L10N_XML_NS) @XmlAccessorType(XmlAccessType.FIELD) public class LocalizedString implements Serializable { @@ -63,13 +59,13 @@ public class LocalizedString implements Serializable { /** * The localised values of the string. */ - @ElementCollection(fetch = FetchType.LAZY) - @MapKeyColumn(name = "LOCALE") - @Column(name = "LOCALIZED_VALUE") - @Basic - @Lob - @Type(type = "org.hibernate.type.TextType") - @Field +// @ElementCollection(fetch = FetchType.LAZY) +// @MapKeyColumn(name = "LOCALE") +// @Column(name = "LOCALIZED_VALUE") +// @Basic +// @Lob +// @Type(type = "org.hibernate.type.TextType") +// @Field @XmlElement(name = "values", namespace = L10N_XML_NS) @XmlJavaTypeAdapter(LocalizedStringValuesAdapter.class) private Map values; @@ -202,6 +198,41 @@ public class LocalizedString implements Serializable { return obj instanceof LocalizedString; } + public static LocalizedString fromJson(final JsonObject jsonObject) { + final LocalizedString localizedString = new LocalizedString(); + + jsonObject + .entrySet() + .stream() + .forEach( + entry -> localizedString.addValue( + new Locale(entry.getKey()), + jsonObject.getString(entry.getKey()) + ) + ); + + return localizedString; + } + + public JsonObjectBuilder buildJson() { + final JsonObjectBuilder builder = Json.createObjectBuilder(); + + values + .entrySet() + .stream() + .forEach( + entry -> builder.add( + entry.getKey().toString(), entry.getValue() + ) + ); + + return builder; + } + + public JsonObject toJson() { + return buildJson().build(); + } + @Override public String toString() { return String.format( diff --git a/ccm-core/src/main/java/org/libreccm/l10n/LocalizedStringType.java b/ccm-core/src/main/java/org/libreccm/l10n/LocalizedStringType.java new file mode 100644 index 000000000..7e5e58c3d --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/l10n/LocalizedStringType.java @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2020 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.libreccm.l10n; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.usertype.UserType; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.io.StringReader; +import java.io.StringWriter; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.util.Objects; + +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonWriter; + +/** + * + * @author Jens Pelzetter + */ +public class LocalizedStringType implements UserType { + + @Override + public int[] sqlTypes() { + return new int[]{Types.JAVA_OBJECT}; + } + + @Override + public Class returnedClass() { + return LocalizedString.class; + } + + @Override + public boolean equals(final Object obj1, final Object obj2) + throws HibernateException { + return Objects.equals(obj1, obj2); + } + + @Override + public int hashCode(final Object obj) throws HibernateException { + return Objects.hashCode(obj); + } + + @Override + public Object nullSafeGet( + final ResultSet resultSet, + final String[] names, + final SharedSessionContractImplementor session, + final Object owner + ) throws HibernateException, SQLException { + final String cellContent = resultSet.getString(names[0]); + if (cellContent == null) { + return null; + } + + return LocalizedString.fromJson( + Json.createReader(new StringReader(cellContent)).readObject() + ); + } + + @Override + public void nullSafeSet( + final PreparedStatement statement, + final Object value, + final int index, + final SharedSessionContractImplementor session + ) throws HibernateException, SQLException { + final JsonObject jsonObject = ((LocalizedString) value).toJson(); + try (StringWriter strWriter = new StringWriter(); + JsonWriter jsonWriter = Json.createWriter(strWriter)) { + jsonWriter.writeObject(jsonObject); + statement.setObject(index, strWriter.toString(), Types.OTHER); + } catch (IOException ex) { + throw new HibernateException(ex); + } + } + + @Override + public Object deepCopy(final Object value) throws HibernateException { + final byte[] serialized; + try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos)) { + oos.writeObject(value); + oos.flush(); + serialized = bos.toByteArray(); + } catch (IOException ex) { + throw new HibernateException(ex); + } + + final Object obj; + try (final ByteArrayInputStream bais = new ByteArrayInputStream( + serialized + ); + final ObjectInputStream ois = new ObjectInputStream(bais);) { + obj = ois.readObject(); + } catch (IOException | ClassNotFoundException ex) { + throw new HibernateException(ex); + } + + return obj; + } + + @Override + public boolean isMutable() { + return true; + } + + @Override + public Serializable disassemble(final Object value) + throws HibernateException { + return (Serializable) deepCopy(value); + } + + @Override + public Object assemble(final Serializable cached, final Object owner) throws + HibernateException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object replace( + final Object original, + final Object target, + final Object owner + ) throws HibernateException { + return deepCopy(original); + } + +} diff --git a/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java b/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java index a594baf6a..5ca59e41b 100644 --- a/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java +++ b/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java @@ -18,6 +18,7 @@ */ package org.libreccm.pagemodel; +import org.hibernate.annotations.Type; import org.libreccm.core.CoreConstants; import org.libreccm.l10n.LocalizedString; import org.libreccm.web.CcmApplication; @@ -225,27 +226,31 @@ public class PageModel implements Serializable { * The localised title of this {@code PageModel} (shown in the * administration UI), */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "PAGE_MODEL_TITLES", - schema = CoreConstants.DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "PAGE_MODEL_ID") - })) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "PAGE_MODEL_TITLES", +// schema = CoreConstants.DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "PAGE_MODEL_ID") +// })) + @Column(name = "TITLE") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString title; /** * A description of this {@code PageModel} describing its purpose. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "PAGE_MODEL_DESCRIPTIONS", - schema = CoreConstants.DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "PAGE_MODEL_ID") - })) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "PAGE_MODEL_DESCRIPTIONS", +// schema = CoreConstants.DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "PAGE_MODEL_ID") +// })) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description; /** diff --git a/ccm-core/src/main/java/org/libreccm/security/Role.java b/ccm-core/src/main/java/org/libreccm/security/Role.java index c1b56f900..bed7ea1ef 100644 --- a/ccm-core/src/main/java/org/libreccm/security/Role.java +++ b/ccm-core/src/main/java/org/libreccm/security/Role.java @@ -29,6 +29,7 @@ import org.libreccm.workflow.TaskAssignment; import static org.libreccm.core.CoreConstants.CORE_XML_NS; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; import org.libreccm.imexport.Exportable; import java.io.Serializable; @@ -182,14 +183,16 @@ public class Role implements Serializable, Exportable { /** * An optional description for a role. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "ROLE_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "ROLE_ID") - })) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "ROLE_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "ROLE_ID") +// })) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") @XmlElement(name = "description", namespace = CORE_XML_NS) private LocalizedString description = new LocalizedString(); diff --git a/ccm-core/src/main/java/org/libreccm/workflow/Task.java b/ccm-core/src/main/java/org/libreccm/workflow/Task.java index 6ba16680b..ea8f8e3e9 100644 --- a/ccm-core/src/main/java/org/libreccm/workflow/Task.java +++ b/ccm-core/src/main/java/org/libreccm/workflow/Task.java @@ -36,6 +36,8 @@ import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; + import javax.persistence.AssociationOverride; import javax.persistence.Column; import javax.persistence.Embedded; @@ -147,25 +149,29 @@ public class Task implements Identifiable, Serializable { /** * A human readable, localisable label for the task. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "WORKFLOW_TASK_LABELS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "TASK_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "WORKFLOW_TASK_LABELS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "TASK_ID")})) + @Column(name = "LABEL") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString label; /** * A description of the task. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "WORKFLOW_TASK_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "TASK_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "WORKFLOW_TASK_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "TASK_ID")})) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description; /** diff --git a/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java b/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java index 6f3b3e734..6f350a033 100644 --- a/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java +++ b/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java @@ -56,6 +56,7 @@ import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import org.hibernate.annotations.Type; import org.libreccm.imexport.Exportable; /** @@ -116,26 +117,30 @@ public class Workflow implements Identifiable, Serializable, Exportable { /** * Human readable name of the workflow. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "WORKFLOW_NAMES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "WORKFLOW_ID")})) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "WORKFLOW_NAMES", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "WORKFLOW_ID")})) + @Column(name = "NAME") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString name = new LocalizedString(); /** * Description of the workflow. */ - @Embedded - @AssociationOverride( - name = "values", - joinTable = @JoinTable(name = "WORKFLOW_DESCRIPTIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "WORKFLOW_ID") - })) +// @Embedded +// @AssociationOverride( +// name = "values", +// joinTable = @JoinTable(name = "WORKFLOW_DESCRIPTIONS", +// schema = DB_SCHEMA, +// joinColumns = { +// @JoinColumn(name = "WORKFLOW_ID") +// })) + @Column(name = "DESCRIPTION") + @Type(type = "org.libreccm.l10n.LocalizedStringType") private LocalizedString description = new LocalizedString(); /** diff --git a/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/002_create_ccm_core_tables.sql b/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/002_create_ccm_core_tables.sql index ddba5e676..7e528ef73 100644 --- a/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/002_create_ccm_core_tables.sql +++ b/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/002_create_ccm_core_tables.sql @@ -4,15 +4,15 @@ -- create schema CCM_CORE; - create table CCM_CORE.APPLICATIONS ( - APPLICATION_TYPE varchar(1024) not null, + create table CCM_CORE.APPLICATIONS ( + APPLICATION_TYPE varchar(1024) not null, PRIMARY_URL varchar(1024) not null, OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.ATTACHMENTS ( - ATTACHMENT_ID bigint not null, + ATTACHMENT_ID bigint not null, ATTACHMENT_DATA blob, DESCRIPTION varchar(255), MIME_TYPE varchar(255), @@ -22,10 +22,12 @@ ); create table CCM_CORE.CATEGORIES ( - ABSTRACT_CATEGORY boolean, + ABSTRACT_CATEGORY boolean, CATEGORY_ORDER bigint, + DESCRIPTION json, ENABLED boolean, NAME varchar(255) not null, + TITLE json, UNIQUE_ID varchar(255), VISIBLE boolean, OBJECT_ID bigint not null, @@ -34,7 +36,7 @@ ); create table CCM_CORE.CATEGORIZATIONS ( - CATEGORIZATION_ID bigint not null, + CATEGORIZATION_ID bigint not null, CATEGORY_ORDER bigint, CATEGORY_INDEX boolean, OBJECT_ORDER bigint, @@ -45,16 +47,11 @@ primary key (CATEGORIZATION_ID) ); - create table CCM_CORE.CATEGORY_DESCRIPTIONS ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - create table CCM_CORE.CATEGORY_DOMAINS ( + DESCRIPTION json, DOMAIN_KEY varchar(255) not null, RELEASED timestamp, + TITLE json, URI varchar(1024), VERSION varchar(255), OBJECT_ID bigint not null, @@ -62,22 +59,15 @@ primary key (OBJECT_ID) ); - create table CCM_CORE.CATEGORY_TITLES ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - create table CCM_CORE.CCM_OBJECTS ( - OBJECT_ID bigint not null, + OBJECT_ID bigint not null, DISPLAY_NAME varchar(255), UUID varchar(255), primary key (OBJECT_ID) ); create table CCM_CORE.CCM_OBJECTS_AUD ( - OBJECT_ID bigint not null, + OBJECT_ID bigint not null, REV integer not null, REVTYPE tinyint, REVEND integer, @@ -86,21 +76,22 @@ ); create table CCM_CORE.CCM_REVISIONS ( - id integer not null, + id integer not null, timestamp bigint not null, USER_NAME varchar(255), primary key (id) ); create table CCM_CORE.CCM_ROLES ( - ROLE_ID bigint not null, + ROLE_ID bigint not null, + DESCRIPTION json, NAME varchar(512) not null, UUID varchar(255) not null, primary key (ROLE_ID) ); create table CCM_CORE.DIGESTS ( - FREQUENCY integer, + FREQUENCY integer, HEADER varchar(4096) not null, NEXT_RUN timestamp, DIGEST_SEPARATOR varchar(128) not null, @@ -111,15 +102,8 @@ primary key (OBJECT_ID) ); - create table CCM_CORE.DOMAIN_DESCRIPTIONS ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - create table CCM_CORE.DOMAIN_OWNERSHIPS ( - OWNERSHIP_ID bigint not null, + OWNERSHIP_ID bigint not null, CONTEXT varchar(255), DOMAIN_ORDER bigint, OWNER_ORDER bigint, @@ -129,25 +113,12 @@ primary key (OWNERSHIP_ID) ); - create table CCM_CORE.DOMAIN_TITLES ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - - create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( - COMPONENT_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (COMPONENT_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_COMPONENTS ( - ACTIVE boolean, + ACTIVE boolean, ADMIN_NAME varchar(255), ATTRIBUTE_STRING varchar(255), COMPONENT_ORDER bigint, + DESCRIPTION json, SELECTED boolean, OBJECT_ID bigint not null, parentComponent_OBJECT_ID bigint, @@ -155,7 +126,7 @@ ); create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER ( - BODY clob, + BODY clob, FROM_EMAIL varchar(255), SUBJECT varchar(255), OBJECT_ID bigint not null, @@ -163,46 +134,34 @@ ); create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS ( - URL varchar(255), + URL varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS ( - MULTIPLE boolean, + MULTIPLE boolean, QUERY varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_DATA_QUERIES ( + DESCRIPTION json, + NAME json, QUERY_ID varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( - DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (DATA_QUERY_ID, LOCALE) - ); - - create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( - DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (DATA_QUERY_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_FORMSECTIONS ( - FORMSECTION_ACTION varchar(255), + FORMSECTION_ACTION varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_LISTENERS ( - ATTRIBUTE_STRING varchar(255), + ATTRIBUTE_STRING varchar(255), CLASS_NAME varchar(255), OBJECT_ID bigint not null, widget_OBJECT_ID bigint, @@ -210,7 +169,7 @@ ); create table CCM_CORE.FORMBUILDER_METAOBJECTS ( - CLASS_NAME varchar(255), + CLASS_NAME varchar(255), PRETTY_NAME varchar(255), PRETTY_PLURAL varchar(255), PROPERTIES_FORM varchar(255), @@ -219,41 +178,23 @@ ); create table CCM_CORE.FORMBUILDER_OBJECT_TYPES ( - APP_NAME varchar(255), + APP_NAME varchar(255), CLASS_NAME varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( - OPTION_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (OPTION_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_OPTIONS ( + LABEL json, PARAMETER_VALUE varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( - PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (PROCESS_LISTENER_ID, LOCALE) - ); - - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( - PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (PROCESS_LISTENER_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( + DESCRIPTION json, LISTENER_CLASS varchar(255), + NAME json, PROCESS_LISTENER_ORDER bigint, OBJECT_ID bigint not null, formSection_OBJECT_ID bigint, @@ -261,20 +202,20 @@ ); create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER ( - REMOTE_URL varchar(2048), + REMOTE_URL varchar(2048), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS ( - RECIPIENT varchar(255), + RECIPIENT varchar(255), SUBJECT varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS ( - BODY clob, + BODY clob, RECIPIENT varchar(255), SUBJECT varchar(255), OBJECT_ID bigint not null, @@ -282,7 +223,7 @@ ); create table CCM_CORE.FORMBUILDER_WIDGETS ( - DEFAULT_VALUE varchar(255), + DEFAULT_VALUE varchar(255), PARAMETER_MODEL varchar(255), PARAMETER_NAME varchar(255), OBJECT_ID bigint not null, @@ -290,14 +231,14 @@ ); create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS ( - RECIPIENT varchar(255), + RECIPIENT varchar(255), SUBJECT varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.GROUP_MEMBERSHIPS ( - MEMBERSHIP_ID bigint not null, + MEMBERSHIP_ID bigint not null, UUID varchar(255) not null, GROUP_ID bigint, MEMBER_ID bigint, @@ -305,33 +246,33 @@ ); create table CCM_CORE.GROUPS ( - PARTY_ID bigint not null, + PARTY_ID bigint not null, primary key (PARTY_ID) ); create table CCM_CORE.HOSTS ( - HOST_ID bigint not null, + HOST_ID bigint not null, SERVER_NAME varchar(512), SERVER_PORT bigint, primary key (HOST_ID) ); create table CCM_CORE.INITS ( - INITIALIZER_ID bigint not null, + INITIALIZER_ID bigint not null, CLASS_NAME varchar(255), REQUIRED_BY_ID bigint, primary key (INITIALIZER_ID) ); create table CCM_CORE.INSTALLED_MODULES ( - MODULE_ID integer not null, + MODULE_ID integer not null, MODULE_CLASS_NAME varchar(2048), STATUS varchar(255), primary key (MODULE_ID) ); create table CCM_CORE.LUCENE_DOCUMENTS ( - DOCUMENT_ID bigint not null, + DOCUMENT_ID bigint not null, CONTENT clob, CONTENT_SECTION varchar(512), COUNTRY varchar(8), @@ -350,14 +291,14 @@ ); create table CCM_CORE.LUCENE_INDEXES ( - INDEX_ID bigint not null, + INDEX_ID bigint not null, LUCENE_INDEX_ID bigint, HOST_ID bigint, primary key (INDEX_ID) ); create table CCM_CORE.MESSAGES ( - BODY varchar(255), + BODY varchar(255), BODY_MIME_TYPE varchar(255), SENT timestamp, SUBJECT varchar(255), @@ -368,7 +309,7 @@ ); create table CCM_CORE.NOTIFICATIONS ( - EXPAND_GROUP boolean, + EXPAND_GROUP boolean, EXPUNGE boolean, EXPUNGE_MESSAGE boolean, FULFILL_DATE timestamp, @@ -385,7 +326,7 @@ ); create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( - TOKEN_ID bigint not null, + TOKEN_ID bigint not null, PURPOSE varchar(255), TOKEN varchar(255), VALID_UNTIL timestamp, @@ -394,7 +335,7 @@ ); create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS ( - COMPONENT_MODEL_ID bigint not null, + COMPONENT_MODEL_ID bigint not null, CLASS_ATTRIBUTE varchar(512), ID_ATTRIBUTE varchar(255), COMPONENT_KEY varchar(255), @@ -406,7 +347,7 @@ ); create table CCM_CORE.PAGE_MODEL_CONTAINER_MODELS ( - CONTAINER_ID bigint not null, + CONTAINER_ID bigint not null, CONTAINER_UUID varchar(255) not null, CONTAINER_KEY varchar(255), UUID varchar(255) not null, @@ -415,25 +356,13 @@ primary key (CONTAINER_ID) ); - create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( - PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (PAGE_MODEL_ID, LOCALE) - ); - - create table CCM_CORE.PAGE_MODEL_TITLES ( - PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (PAGE_MODEL_ID, LOCALE) - ); - create table CCM_CORE.PAGE_MODELS ( - PAGE_MODEL_ID bigint not null, + PAGE_MODEL_ID bigint not null, + DESCRIPTION json, LAST_MODIFIED timestamp, MODEL_UUID varchar(255) not null, NAME varchar(255), + TITLE json, TYPE varchar(255) not null, UUID varchar(255) not null, VERSION varchar(255) not null, @@ -442,14 +371,14 @@ ); create table CCM_CORE.PARTIES ( - PARTY_ID bigint not null, + PARTY_ID bigint not null, NAME varchar(256) not null, UUID varchar(255) not null, primary key (PARTY_ID) ); create table CCM_CORE.PERMISSIONS ( - PERMISSION_ID bigint not null, + PERMISSION_ID bigint not null, CREATION_DATE timestamp, CREATION_IP varchar(255), GRANTED_PRIVILEGE varchar(255), @@ -463,13 +392,13 @@ ); create table CCM_CORE.PORTALS ( - TEMPLATE boolean, + TEMPLATE boolean, OBJECT_ID bigint not null, primary key (OBJECT_ID) ); create table CCM_CORE.PORTLETS ( - CELL_NUMBER bigint, + CELL_NUMBER bigint, SORT_KEY bigint, OBJECT_ID bigint not null, PORTAL_ID bigint, @@ -477,7 +406,7 @@ ); create table CCM_CORE.QUEUE_ITEMS ( - QUEUE_ITEM_ID bigint not null, + QUEUE_ITEM_ID bigint not null, HEADER varchar(4096), RECEIVER_ADDRESS varchar(512), RETRY_COUNT bigint, @@ -488,29 +417,9 @@ primary key (QUEUE_ITEM_ID) ); - create table CCM_CORE.RESOURCE_DESCRIPTIONS ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - - create table CCM_CORE.RESOURCE_TITLES ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - - create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( - RESOURCE_TYPE_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (RESOURCE_TYPE_ID, LOCALE) - ); - create table CCM_CORE.RESOURCE_TYPES ( - RESOURCE_TYPE_ID bigint not null, + RESOURCE_TYPE_ID bigint not null, + DESCRIPTION json, SINGLETON boolean, TITLE varchar(254) not null, UUID varchar(255) not null, @@ -521,22 +430,17 @@ ); create table CCM_CORE.RESOURCES ( - CREATED timestamp, + CREATED timestamp, + DESCRIPTION json, + TITLE json, OBJECT_ID bigint not null, parent_OBJECT_ID bigint, resourceType_RESOURCE_TYPE_ID bigint, primary key (OBJECT_ID) ); - create table CCM_CORE.ROLE_DESCRIPTIONS ( - ROLE_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (ROLE_ID, LOCALE) - ); - create table CCM_CORE.ROLE_MEMBERSHIPS ( - MEMBERSHIP_ID bigint not null, + MEMBERSHIP_ID bigint not null, UUID varchar(255) not null, MEMBER_ID bigint, ROLE_ID bigint, @@ -544,43 +448,37 @@ ); create table CCM_CORE.SETTINGS ( - DTYPE varchar(31) not null, + DTYPE varchar(31) not null, SETTING_ID bigint not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, + SETTING_VALUE_DOUBLE double, + SETTING_VALUE_BIG_DECIMAL decimal(19,2), + SETTING_VALUE json, SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_LONG bigint, SETTING_VALUE_STRING varchar(1024), - SETTING_VALUE_DOUBLE double, - SETTING_VALUE_BIG_DECIMAL decimal(19,2), primary key (SETTING_ID) ); create table CCM_CORE.SETTINGS_ENUM_VALUES ( - ENUM_ID bigint not null, + ENUM_ID bigint not null, value varchar(255) ); - create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( - ENTRY_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (ENTRY_ID, LOCALE) - ); - create table CCM_CORE.SETTINGS_STRING_LIST ( - LIST_ID bigint not null, + LIST_ID bigint not null, value varchar(255) ); create table CCM_CORE.SITE_AWARE_APPLICATIONS ( - OBJECT_ID bigint not null, + OBJECT_ID bigint not null, SITE_ID bigint, primary key (OBJECT_ID) ); create table CCM_CORE.SITES ( - DEFAULT_SITE boolean, + DEFAULT_SITE boolean, DEFAULT_THEME varchar(255), DOMAIN_OF_SITE varchar(255), OBJECT_ID bigint not null, @@ -588,7 +486,7 @@ ); create table CCM_CORE.STYLE_MEDIA_QUERIES ( - MEDIA_QUERY_ID bigint not null, + MEDIA_QUERY_ID bigint not null, MAX_WIDTH_UNIT varchar(255), MAX_WIDTH_VALUE double, MEDIA_TYPE varchar(255), @@ -598,14 +496,14 @@ ); create table CCM_CORE.STYLE_MEDIA_RULES ( - MEDIA_RULE_ID bigint not null, + MEDIA_RULE_ID bigint not null, MEDIA_QUERY_ID bigint, STYLE_ID bigint, primary key (MEDIA_RULE_ID) ); create table CCM_CORE.STYLE_PROPERTIES ( - PROPERTY_ID bigint not null, + PROPERTY_ID bigint not null, NAME varchar(256), PROPERTY_VALUE varchar(4096), RULE_ID bigint, @@ -613,20 +511,20 @@ ); create table CCM_CORE.STYLE_RULES ( - RULE_ID bigint not null, + RULE_ID bigint not null, SELECTOR varchar(2048), STYLE_ID bigint, primary key (RULE_ID) ); create table CCM_CORE.STYLES ( - STYLE_ID bigint not null, + STYLE_ID bigint not null, STYLENAME varchar(255), primary key (STYLE_ID) ); create table CCM_CORE.THEME_DATA_FILES ( - CREATION_DATE timestamp, + CREATION_DATE timestamp, FILE_DATA blob, LAST_MODIFIED timestamp, FILE_SIZE bigint, @@ -636,12 +534,12 @@ ); create table CCM_CORE.theme_directories ( - FILE_ID bigint not null, + FILE_ID bigint not null, primary key (FILE_ID) ); create table CCM_CORE.THEME_FILES ( - FILE_ID bigint not null, + FILE_ID bigint not null, NAME varchar(255) not null, FILE_PATH varchar(8192) not null, UUID varchar(255) not null, @@ -652,7 +550,7 @@ ); create table CCM_CORE.THEMES ( - THEME_ID bigint not null, + THEME_ID bigint not null, NAME varchar(255), UUID varchar(255), VERSION varchar(255), @@ -661,20 +559,20 @@ ); create table CCM_CORE.THREADS ( - OBJECT_ID bigint not null, + OBJECT_ID bigint not null, ROOT_ID bigint, primary key (OBJECT_ID) ); create table CCM_CORE.USER_EMAIL_ADDRESSES ( - USER_ID bigint not null, + USER_ID bigint not null, EMAIL_ADDRESS varchar(512) not null, BOUNCING boolean, VERIFIED boolean ); create table CCM_CORE.USERS ( - BANNED boolean, + BANNED boolean, FAMILY_NAME varchar(512), GIVEN_NAME varchar(512), PASSWORD varchar(2048), @@ -687,7 +585,7 @@ ); create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS ( - DUE_DATE timestamp, + DUE_DATE timestamp, DURATION_MINUTES bigint, LOCKED boolean, START_DATE timestamp, @@ -697,22 +595,8 @@ primary key (TASK_ID) ); - create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( - WORKFLOW_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (WORKFLOW_ID, LOCALE) - ); - - create table CCM_CORE.WORKFLOW_NAMES ( - WORKFLOW_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (WORKFLOW_ID, LOCALE) - ); - create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS ( - TASK_ASSIGNMENT_ID bigint not null, + TASK_ASSIGNMENT_ID bigint not null, UUID varchar(255) not null, ROLE_ID bigint, TASK_ID bigint, @@ -720,7 +604,7 @@ ); create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( - COMMENT_ID bigint not null, + COMMENT_ID bigint not null, COMMENT varchar(2147483647), UUID varchar(255) not null, AUTHOR_ID bigint, @@ -729,30 +613,18 @@ ); create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( - TASK_DEPENDENCY_ID bigint not null, + TASK_DEPENDENCY_ID bigint not null, uuid varchar(255) not null, BLOCKED_TASK_ID bigint, BLOCKING_TASK_ID bigint, primary key (TASK_DEPENDENCY_ID) ); - create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( - TASK_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (TASK_ID, LOCALE) - ); - - create table CCM_CORE.WORKFLOW_TASK_LABELS ( - TASK_ID bigint not null, - LOCALIZED_VALUE varchar(2147483647), - LOCALE varchar(255) not null, - primary key (TASK_ID, LOCALE) - ); - create table CCM_CORE.WORKFLOW_TASKS ( - TASK_ID bigint not null, + TASK_ID bigint not null, ACTIVE boolean, + DESCRIPTION json, + LABEL json, TASK_STATE varchar(512), UUID varchar(255) not null, WORKFLOW_ID bigint, @@ -760,9 +632,11 @@ ); create table CCM_CORE.WORKFLOWS ( - WORKFLOW_ID bigint not null, + WORKFLOW_ID bigint not null, abstract_workflow boolean, ACTIVE boolean, + DESCRIPTION json, + NAME json, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), UUID varchar(255) not null, @@ -772,647 +646,542 @@ ); alter table CCM_CORE.CATEGORIZATIONS - add constraint UK_da7jus3wn1tr8poyaw9btxbrc unique (UUID); + add constraint UK_da7jus3wn1tr8poyaw9btxbrc unique (UUID); alter table CCM_CORE.CATEGORY_DOMAINS - add constraint UK_mb1riernf8a88u3mwl0bgfj8y unique (DOMAIN_KEY); + add constraint UK_mb1riernf8a88u3mwl0bgfj8y unique (DOMAIN_KEY); alter table CCM_CORE.CATEGORY_DOMAINS - add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); + add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); alter table CCM_CORE.CCM_OBJECTS - add constraint UK_1cm71jlagvyvcnkqvxqyit3wx unique (UUID); + add constraint UK_1cm71jlagvyvcnkqvxqyit3wx unique (UUID); alter table CCM_CORE.CCM_ROLES - add constraint UK_rfmsjqsq6kagolsod3ufkugll unique (UUID); + add constraint UK_rfmsjqsq6kagolsod3ufkugll unique (UUID); alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint UK_j86gai9740v9hshascbsboudb unique (UUID); + add constraint UK_j86gai9740v9hshascbsboudb unique (UUID); alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint UK_kkdoia60bmiwhhdru169p3n9g unique (UUID); + add constraint UK_kkdoia60bmiwhhdru169p3n9g unique (UUID); alter table CCM_CORE.HOSTS - add constraint UK9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); + add constraint UK9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); alter table CCM_CORE.INSTALLED_MODULES - add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); + add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); alter table CCM_CORE.PARTIES - add constraint UK_1hv061qace2mn4loroe3fwdel unique (UUID); + add constraint UK_1hv061qace2mn4loroe3fwdel unique (UUID); alter table CCM_CORE.PERMISSIONS - add constraint UK_p50se7rdexv7xnkiqsl6ijyti unique (UUID); + add constraint UK_p50se7rdexv7xnkiqsl6ijyti unique (UUID); alter table CCM_CORE.RESOURCE_TYPES - add constraint UK_ioax2ix2xmq3nw7el5k6orggb unique (UUID); + add constraint UK_ioax2ix2xmq3nw7el5k6orggb unique (UUID); alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint UK_82wdq214bfs99eii71fp50s97 unique (UUID); + add constraint UK_82wdq214bfs99eii71fp50s97 unique (UUID); alter table CCM_CORE.SETTINGS - add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); + add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); alter table CCM_CORE.SITES - add constraint UK_kou1h4y4st2m173he44yy8grx unique (DOMAIN_OF_SITE); + add constraint UK_kou1h4y4st2m173he44yy8grx unique (DOMAIN_OF_SITE); alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS - add constraint UK_gv93k167pe9qy3go9vjau1q2t unique (UUID); + add constraint UK_gv93k167pe9qy3go9vjau1q2t unique (UUID); alter table CCM_CORE.WORKFLOW_TASK_COMMENTS - add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID); + add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID); alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES - add constraint UK_787va2ep8ucoul29qgsoaxnub unique (uuid); + add constraint UK_787va2ep8ucoul29qgsoaxnub unique (uuid); alter table CCM_CORE.WORKFLOW_TASKS - add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID); + add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID); alter table CCM_CORE.WORKFLOWS - add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); -create sequence hibernate_sequence start with 100000 increment by 1; + add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); +create sequence hibernate_sequence start with 1 increment by 1; alter table CCM_CORE.APPLICATIONS - add constraint FKatcp9ij6mbkx0nfeig1o6n3lm - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FKatcp9ij6mbkx0nfeig1o6n3lm + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.ATTACHMENTS - add constraint FK8ju9hm9baceridp803nislkwb - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; + add constraint FK8ju9hm9baceridp803nislkwb + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.CATEGORIES - add constraint FKrj3marx99nheur4fqanm0ylur - foreign key (PARENT_CATEGORY_ID) - references CCM_CORE.CATEGORIES; + add constraint FKrj3marx99nheur4fqanm0ylur + foreign key (PARENT_CATEGORY_ID) + references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORIES - add constraint FKpm291swli2musd0204phta652 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKpm291swli2musd0204phta652 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FKejp0ubk034nfq60v1po6srkke - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKejp0ubk034nfq60v1po6srkke + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FKoyeipswl876wa6mqwbx0uy83h - foreign key (CATEGORY_ID) - references CCM_CORE.CATEGORIES; - - alter table CCM_CORE.CATEGORY_DESCRIPTIONS - add constraint FKhiwjlmh5vkbu3v3vng1la1qum - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORIES; + add constraint FKoyeipswl876wa6mqwbx0uy83h + foreign key (CATEGORY_ID) + references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FKf25vi73cji01w8fgo6ow1dgg - foreign key (ROOT_CATEGORY_ID) - references CCM_CORE.CATEGORIES; + add constraint FKf25vi73cji01w8fgo6ow1dgg + foreign key (ROOT_CATEGORY_ID) + references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FK58xpmnvciohkom1c16oua4xha - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.CATEGORY_TITLES - add constraint FKka9bt9f5br0kji5bcjxcmf6ch - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORIES; + add constraint FK58xpmnvciohkom1c16oua4xha + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CCM_OBJECTS_AUD - add constraint FKr00eauutiyvocno8ckx6h9nw6 - foreign key (REV) - references CCM_CORE.CCM_REVISIONS; + add constraint FKr00eauutiyvocno8ckx6h9nw6 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; alter table CCM_CORE.CCM_OBJECTS_AUD - add constraint FKo5s37ctcdny7tmewjwv7705h5 - foreign key (REVEND) - references CCM_CORE.CCM_REVISIONS; + add constraint FKo5s37ctcdny7tmewjwv7705h5 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; alter table CCM_CORE.DIGESTS - add constraint FKc53g09agnye3w1v4euy3e0gsi - foreign key (FROM_PARTY_ID) - references CCM_CORE.PARTIES; + add constraint FKc53g09agnye3w1v4euy3e0gsi + foreign key (FROM_PARTY_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.DIGESTS - add constraint FK845r9ep6xu6nbt1mvxulwybym - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.DOMAIN_DESCRIPTIONS - add constraint FKn4i2dxgn8cqysa62dds6eih6a - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORY_DOMAINS; + add constraint FK845r9ep6xu6nbt1mvxulwybym + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK47nsasr7jrdwlky5gx0u6e9py - foreign key (domain_OBJECT_ID) - references CCM_CORE.CATEGORY_DOMAINS; + add constraint FK47nsasr7jrdwlky5gx0u6e9py + foreign key (domain_OBJECT_ID) + references CCM_CORE.CATEGORY_DOMAINS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK3u4hq6yqau4m419b1xva3xpwq - foreign key (owner_OBJECT_ID) - references CCM_CORE.APPLICATIONS; - - alter table CCM_CORE.DOMAIN_TITLES - add constraint FK5p526dsdwn94els6lp5w0hdn4 - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORY_DOMAINS; - - alter table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS - add constraint FKfh0k9lj3pf4amfc9bbbss0tr1 - foreign key (COMPONENT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FK3u4hq6yqau4m419b1xva3xpwq + foreign key (owner_OBJECT_ID) + references CCM_CORE.APPLICATIONS; alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FKpcpmvyiix023b4g5n4q8nkfca - foreign key (parentComponent_OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FKpcpmvyiix023b4g5n4q8nkfca + foreign key (parentComponent_OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FKt0e0uv00pp1rwhyaltrytghnm - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKt0e0uv00pp1rwhyaltrytghnm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER - add constraint FK48khrbud3xhi2gvsvnlttd8tg - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FK48khrbud3xhi2gvsvnlttd8tg + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS - add constraint FKbyjjt2ufendvje2obtge2l7et - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKbyjjt2ufendvje2obtge2l7et + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS - add constraint FK8oriyta1957u7dvbrqk717944 - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_WIDGETS; + add constraint FK8oriyta1957u7dvbrqk717944 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_DATA_QUERIES - add constraint FKhhaxpeddbtmrnjr5o0fopju3a - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS - add constraint FKsmduu1opoiulkeo2gc8v7lsbn - foreign key (DATA_QUERY_ID) - references CCM_CORE.FORMBUILDER_DATA_QUERIES; - - alter table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES - add constraint FKju1x82inrw3kguyjuxoetn6gn - foreign key (DATA_QUERY_ID) - references CCM_CORE.FORMBUILDER_DATA_QUERIES; + add constraint FKhhaxpeddbtmrnjr5o0fopju3a + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_FORMSECTIONS - add constraint FKnfhsgxp4lvigq2pm33pn4afac - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FKnfhsgxp4lvigq2pm33pn4afac + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FK33ilyirwoux28yowafgd5xx0o - foreign key (widget_OBJECT_ID) - references CCM_CORE.FORMBUILDER_WIDGETS; + add constraint FK33ilyirwoux28yowafgd5xx0o + foreign key (widget_OBJECT_ID) + references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FKlqm76746nq5yrt8ganm474uu0 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKlqm76746nq5yrt8ganm474uu0 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_METAOBJECTS - add constraint FKf963v6u9mw8pwjmasrw51w8dx - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKf963v6u9mw8pwjmasrw51w8dx + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_OBJECT_TYPES - add constraint FKkv337e83rsecf0h3qy8bu7l9w - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.FORMBUILDER_OPTION_LABELS - add constraint FKatlsylsvln6yse55eof6wwkj6 - foreign key (OPTION_ID) - references CCM_CORE.FORMBUILDER_OPTIONS; + add constraint FKkv337e83rsecf0h3qy8bu7l9w + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_OPTIONS - add constraint FKhe5q71wby9g4i56sotc501h11 - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; - - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS - add constraint FKcv3iu04gxjk9c0pn6tl8rqqv3 - foreign key (PROCESS_LISTENER_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; - - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES - add constraint FK8rnyb1m6ij3b9hhmhr7klgd4p - foreign key (PROCESS_LISTENER_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKhe5q71wby9g4i56sotc501h11 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FK7uiaeax8qafm82e5k729ms5ku - foreign key (formSection_OBJECT_ID) - references CCM_CORE.FORMBUILDER_FORMSECTIONS; + add constraint FK7uiaeax8qafm82e5k729ms5ku + foreign key (formSection_OBJECT_ID) + references CCM_CORE.FORMBUILDER_FORMSECTIONS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FKbdnloo884qk6gn36jwiqv5rlp - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKbdnloo884qk6gn36jwiqv5rlp + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER - add constraint FKpajvu9m6fj1enm67a9gcb5ii9 - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKpajvu9m6fj1enm67a9gcb5ii9 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS - add constraint FKsn82ktlq0c9ikijyv8k2bfv4f - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKsn82ktlq0c9ikijyv8k2bfv4f + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS - add constraint FK8kjyu72btjsuaaqh4bvd8npns - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FK8kjyu72btjsuaaqh4bvd8npns + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_WIDGETS - add constraint FK1wosr4ujbfckdc50u5fgmrhrk - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FK1wosr4ujbfckdc50u5fgmrhrk + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS - add constraint FKjie9co03m7ow4ihig5rk7l8oj - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKjie9co03m7ow4ihig5rk7l8oj + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FKq4qnny8ri3eo7eqh4olxco8nk - foreign key (GROUP_ID) - references CCM_CORE.GROUPS; + add constraint FKq4qnny8ri3eo7eqh4olxco8nk + foreign key (GROUP_ID) + references CCM_CORE.GROUPS; alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FKc8u86ivkhvoiw6ju8b2p365he - foreign key (MEMBER_ID) - references CCM_CORE.USERS; + add constraint FKc8u86ivkhvoiw6ju8b2p365he + foreign key (MEMBER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.GROUPS - add constraint FK4f61mlqxw0ct6s7wwpi9m0735 - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; + add constraint FK4f61mlqxw0ct6s7wwpi9m0735 + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.INITS - add constraint FK3nvvxk10nmq9nfuko8yklqdgc - foreign key (REQUIRED_BY_ID) - references CCM_CORE.INITS; + add constraint FK3nvvxk10nmq9nfuko8yklqdgc + foreign key (REQUIRED_BY_ID) + references CCM_CORE.INITS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FK942kl4yff8rdiwr0pjk2a9g8 - foreign key (CREATED_BY_PARTY_ID) - references CCM_CORE.USERS; + add constraint FK942kl4yff8rdiwr0pjk2a9g8 + foreign key (CREATED_BY_PARTY_ID) + references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FKc5rs6afx4p9fidabfqsxr5ble - foreign key (LAST_MODIFIED_BY) - references CCM_CORE.USERS; + add constraint FKc5rs6afx4p9fidabfqsxr5ble + foreign key (LAST_MODIFIED_BY) + references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_INDEXES - add constraint FK6gu0yrlviqk07dtb3r02iw43f - foreign key (HOST_ID) - references CCM_CORE.HOSTS; + add constraint FK6gu0yrlviqk07dtb3r02iw43f + foreign key (HOST_ID) + references CCM_CORE.HOSTS; alter table CCM_CORE.MESSAGES - add constraint FKph10aehmg9f20pn2w4buki97q - foreign key (IN_REPLY_TO_ID) - references CCM_CORE.MESSAGES; + add constraint FKph10aehmg9f20pn2w4buki97q + foreign key (IN_REPLY_TO_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.MESSAGES - add constraint FKjufsx3c3h538fj35h8hgfnb1p - foreign key (SENDER_ID) - references CCM_CORE.USERS; + add constraint FKjufsx3c3h538fj35h8hgfnb1p + foreign key (SENDER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.MESSAGES - add constraint FK6w20ao7scwecd9mfwpun2ddqx - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FK6w20ao7scwecd9mfwpun2ddqx + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FKqk70c1x1dklhty9ju5t4wukd9 - foreign key (DIGEST_ID) - references CCM_CORE.DIGESTS; + add constraint FKqk70c1x1dklhty9ju5t4wukd9 + foreign key (DIGEST_ID) + references CCM_CORE.DIGESTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FKtt4fjr2p75og79jxxgd8q8mr - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; + add constraint FKtt4fjr2p75og79jxxgd8q8mr + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.NOTIFICATIONS - add constraint FK2vlnma0ox43j0clx8ead08n5s - foreign key (RECEIVER_ID) - references CCM_CORE.PARTIES; + add constraint FK2vlnma0ox43j0clx8ead08n5s + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.NOTIFICATIONS - add constraint FKf423hhiaw1bexpxeh1pnas7qt - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKf423hhiaw1bexpxeh1pnas7qt + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.ONE_TIME_AUTH_TOKENS - add constraint FKtplfuphkiorfkttaewb4wmfjc - foreign key (USER_ID) - references CCM_CORE.USERS; + add constraint FKtplfuphkiorfkttaewb4wmfjc + foreign key (USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS - add constraint FK1uvkayybawff8sqkmerqt60bk - foreign key (CONTAINER_ID) - references CCM_CORE.PAGE_MODEL_CONTAINER_MODELS; + add constraint FK1uvkayybawff8sqkmerqt60bk + foreign key (CONTAINER_ID) + references CCM_CORE.PAGE_MODEL_CONTAINER_MODELS; alter table CCM_CORE.PAGE_MODEL_CONTAINER_MODELS - add constraint FK1c6drneacxveol92vpum79fxb - foreign key (PAGE_MODEL_ID) - references CCM_CORE.PAGE_MODELS; + add constraint FK1c6drneacxveol92vpum79fxb + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; alter table CCM_CORE.PAGE_MODEL_CONTAINER_MODELS - add constraint FKoi5wphv3vtwryc19akku28p24 - foreign key (STYLE_ID) - references CCM_CORE.STYLES; - - alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS - add constraint FKcc5d6eqxu1369k8ycyyt6vn3e - foreign key (PAGE_MODEL_ID) - references CCM_CORE.PAGE_MODELS; - - alter table CCM_CORE.PAGE_MODEL_TITLES - add constraint FKj14q9911yhd4js9p6rs21rwjf - foreign key (PAGE_MODEL_ID) - references CCM_CORE.PAGE_MODELS; + add constraint FKoi5wphv3vtwryc19akku28p24 + foreign key (STYLE_ID) + references CCM_CORE.STYLES; alter table CCM_CORE.PAGE_MODELS - add constraint FKk2lihllrxj89mn3tqv43amafe - foreign key (APPLICATION_ID) - references CCM_CORE.APPLICATIONS; + add constraint FKk2lihllrxj89mn3tqv43amafe + foreign key (APPLICATION_ID) + references CCM_CORE.APPLICATIONS; alter table CCM_CORE.PERMISSIONS - add constraint FKj9di7pawxgtouxmu2k44bj5c4 - foreign key (CREATION_USER_ID) - references CCM_CORE.USERS; + add constraint FKj9di7pawxgtouxmu2k44bj5c4 + foreign key (CREATION_USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.PERMISSIONS - add constraint FKikx3x0kn9fito23g50v6xbr9f - foreign key (GRANTEE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKikx3x0kn9fito23g50v6xbr9f + foreign key (GRANTEE_ID) + references CCM_CORE.CCM_ROLES; alter table CCM_CORE.PERMISSIONS - add constraint FKg56ujjoe0j30pq579rf0l5yc6 - foreign key (INHERITED_FROM_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKg56ujjoe0j30pq579rf0l5yc6 + foreign key (INHERITED_FROM_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.PERMISSIONS - add constraint FKkamckexjnffnt8lay9nqeawhm - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKkamckexjnffnt8lay9nqeawhm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.PORTALS - add constraint FK5a2hdrbw03mmgr74vj5nxlpvk - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FK5a2hdrbw03mmgr74vj5nxlpvk + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.PORTLETS - add constraint FK9gr5xjt3rx4uhtw7vl6adruol - foreign key (PORTAL_ID) - references CCM_CORE.PORTALS; + add constraint FK9gr5xjt3rx4uhtw7vl6adruol + foreign key (PORTAL_ID) + references CCM_CORE.PORTALS; alter table CCM_CORE.PORTLETS - add constraint FKjmx9uebt0gwxkw3xv34niy35f - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FKjmx9uebt0gwxkw3xv34niy35f + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.QUEUE_ITEMS - add constraint FKtgkwfruv9kjdybf46l02da088 - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; + add constraint FKtgkwfruv9kjdybf46l02da088 + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.QUEUE_ITEMS - add constraint FKs9aq1hyxstwmvx7fmfifp4x7r - foreign key (RECEIVER_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.RESOURCE_DESCRIPTIONS - add constraint FKk9arvj5u21rv23ce3cav4opqx - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TITLES - add constraint FKto4p6n2wklljyf7tmuxtmyfe0 - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS - add constraint FKckpihjtv23iahbg3imnpbsr2 - foreign key (RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; + add constraint FKs9aq1hyxstwmvx7fmfifp4x7r + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.RESOURCES - add constraint FKbo7ibfgodicn9flv2gfo11g5a - foreign key (parent_OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FKbo7ibfgodicn9flv2gfo11g5a + foreign key (parent_OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.RESOURCES - add constraint FK262fbwetpjx3k4uuvw24wsiv - foreign key (resourceType_RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; + add constraint FK262fbwetpjx3k4uuvw24wsiv + foreign key (resourceType_RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; alter table CCM_CORE.RESOURCES - add constraint FKbjdf8pm4frth8r06ev2qjm88f - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.ROLE_DESCRIPTIONS - add constraint FKo09bh4j3k3k0ph3awvjwx31ft - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKbjdf8pm4frth8r06ev2qjm88f + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FK9m88ywi7rcin7b7jrgh53emrq - foreign key (MEMBER_ID) - references CCM_CORE.PARTIES; + add constraint FK9m88ywi7rcin7b7jrgh53emrq + foreign key (MEMBER_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FKcsyogv5m2rgsrmtgnhgkjhfw7 - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKcsyogv5m2rgsrmtgnhgkjhfw7 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; alter table CCM_CORE.SETTINGS_ENUM_VALUES - add constraint FK8mw4p92s0h3h8bmo8saowu32i - foreign key (ENUM_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_L10N_STR_VALUES - add constraint FK5knjq7cisej0qfx5dw1y93rou - foreign key (ENTRY_ID) - references CCM_CORE.SETTINGS; + add constraint FK8mw4p92s0h3h8bmo8saowu32i + foreign key (ENUM_ID) + references CCM_CORE.SETTINGS; alter table CCM_CORE.SETTINGS_STRING_LIST - add constraint FKqeclqa5sf1g53vxs857tpwrus - foreign key (LIST_ID) - references CCM_CORE.SETTINGS; + add constraint FKqeclqa5sf1g53vxs857tpwrus + foreign key (LIST_ID) + references CCM_CORE.SETTINGS; alter table CCM_CORE.SITE_AWARE_APPLICATIONS - add constraint FKopo91c29jaunpcusjwlphhxkd - foreign key (SITE_ID) - references CCM_CORE.SITES; + add constraint FKopo91c29jaunpcusjwlphhxkd + foreign key (SITE_ID) + references CCM_CORE.SITES; alter table CCM_CORE.SITE_AWARE_APPLICATIONS - add constraint FKslbu2qagg23dmdu01lun7oh7x - foreign key (OBJECT_ID) - references CCM_CORE.APPLICATIONS; + add constraint FKslbu2qagg23dmdu01lun7oh7x + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; alter table CCM_CORE.SITES - add constraint FKrca95c6p023men53b8ayu26kp - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKrca95c6p023men53b8ayu26kp + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.STYLE_MEDIA_RULES - add constraint FKdq24a4atxp4c1sbqs8g6lpkx0 - foreign key (MEDIA_QUERY_ID) - references CCM_CORE.STYLE_MEDIA_QUERIES; + add constraint FKdq24a4atxp4c1sbqs8g6lpkx0 + foreign key (MEDIA_QUERY_ID) + references CCM_CORE.STYLE_MEDIA_QUERIES; alter table CCM_CORE.STYLE_MEDIA_RULES - add constraint FKf67h8q9kkjft9go2xo2572n17 - foreign key (STYLE_ID) - references CCM_CORE.STYLES; + add constraint FKf67h8q9kkjft9go2xo2572n17 + foreign key (STYLE_ID) + references CCM_CORE.STYLES; alter table CCM_CORE.STYLE_PROPERTIES - add constraint FKg2g0n7jmce3vjmula0898yp94 - foreign key (RULE_ID) - references CCM_CORE.STYLE_RULES; + add constraint FKg2g0n7jmce3vjmula0898yp94 + foreign key (RULE_ID) + references CCM_CORE.STYLE_RULES; alter table CCM_CORE.STYLE_RULES - add constraint FKf6fb4k6y2d74p70ldmj8awqj3 - foreign key (STYLE_ID) - references CCM_CORE.STYLE_MEDIA_RULES; + add constraint FKf6fb4k6y2d74p70ldmj8awqj3 + foreign key (STYLE_ID) + references CCM_CORE.STYLE_MEDIA_RULES; alter table CCM_CORE.THEME_DATA_FILES - add constraint FK630m2y2p7pp487ofowbefrm89 - foreign key (FILE_ID) - references CCM_CORE.THEME_FILES; + add constraint FK630m2y2p7pp487ofowbefrm89 + foreign key (FILE_ID) + references CCM_CORE.THEME_FILES; alter table CCM_CORE.theme_directories - add constraint FKrmgyslvw22j87n4cxau5jvsou - foreign key (FILE_ID) - references CCM_CORE.THEME_FILES; + add constraint FKrmgyslvw22j87n4cxau5jvsou + foreign key (FILE_ID) + references CCM_CORE.THEME_FILES; alter table CCM_CORE.THEME_FILES - add constraint FKfsycb4bt8d0wye7r3n06ekfeu - foreign key (PARENT_DIRECTORY_ID) - references CCM_CORE.theme_directories; + add constraint FKfsycb4bt8d0wye7r3n06ekfeu + foreign key (PARENT_DIRECTORY_ID) + references CCM_CORE.theme_directories; alter table CCM_CORE.THEME_FILES - add constraint FKke2jj04kjqh91h347g1ut0yff - foreign key (THEME_ID) - references CCM_CORE.THEMES; + add constraint FKke2jj04kjqh91h347g1ut0yff + foreign key (THEME_ID) + references CCM_CORE.THEMES; alter table CCM_CORE.THEMES - add constraint FKlat55c5l3fxbykkibrmv7qi4x - foreign key (ROOT_DIRECTORY_ID) - references CCM_CORE.theme_directories; + add constraint FKlat55c5l3fxbykkibrmv7qi4x + foreign key (ROOT_DIRECTORY_ID) + references CCM_CORE.theme_directories; alter table CCM_CORE.THREADS - add constraint FKsx08mpwvwnw97uwdgjs76q39g - foreign key (ROOT_ID) - references CCM_CORE.MESSAGES; + add constraint FKsx08mpwvwnw97uwdgjs76q39g + foreign key (ROOT_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.THREADS - add constraint FKp97b1sy1kop07rtapeh5l9fb2 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKp97b1sy1kop07rtapeh5l9fb2 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.USER_EMAIL_ADDRESSES - add constraint FKr900l79erul95seyyccf04ufc - foreign key (USER_ID) - references CCM_CORE.USERS; + add constraint FKr900l79erul95seyyccf04ufc + foreign key (USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.USERS - add constraint FKosh928q71aonu6l1kurb417r - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; + add constraint FKosh928q71aonu6l1kurb417r + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS - add constraint FK1pnsq9ur3ylq0ghuj23p4cogs - foreign key (LOCKING_USER_ID) - references CCM_CORE.USERS; + add constraint FK1pnsq9ur3ylq0ghuj23p4cogs + foreign key (LOCKING_USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS - add constraint FK9ngp088m8xa82swy7yg3qx6vh - foreign key (NOTIFICATION_SENDER) - references CCM_CORE.USERS; + add constraint FK9ngp088m8xa82swy7yg3qx6vh + foreign key (NOTIFICATION_SENDER) + references CCM_CORE.USERS; alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS - add constraint FKt9ha3no3bj8a50pnw8cnqh2cq - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; - - alter table CCM_CORE.WORKFLOW_DESCRIPTIONS - add constraint FKgx7upkqky82dpxvbs95imfl9l - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_NAMES - add constraint FKkxedy9p48avfk45r0bn4uc09i - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; + add constraint FKt9ha3no3bj8a50pnw8cnqh2cq + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS - add constraint FKpq4paqtfbi5erhh98wl1ja005 - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKpq4paqtfbi5erhh98wl1ja005 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS - add constraint FK3933ol31co3yn5ee75b2hmhgp - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; + add constraint FK3933ol31co3yn5ee75b2hmhgp + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; alter table CCM_CORE.WORKFLOW_TASK_COMMENTS - add constraint FKd2ymdg8nay9pmh2nn2whba0j8 - foreign key (AUTHOR_ID) - references CCM_CORE.USERS; + add constraint FKd2ymdg8nay9pmh2nn2whba0j8 + foreign key (AUTHOR_ID) + references CCM_CORE.USERS; alter table CCM_CORE.WORKFLOW_TASK_COMMENTS - add constraint FKkfqrf9jdvm7livu5if06w0r5t - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; + add constraint FKkfqrf9jdvm7livu5if06w0r5t + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES - add constraint FKy88tppv7ihx0lsn6g64f5lfq - foreign key (BLOCKED_TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; + add constraint FKy88tppv7ihx0lsn6g64f5lfq + foreign key (BLOCKED_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES - add constraint FKrj80uilojn73u9a4xgk3vt0cj - foreign key (BLOCKING_TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; - - alter table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS - add constraint FKeb7mqbdx3bk7t01vo7kp2hpf - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; - - alter table CCM_CORE.WORKFLOW_TASK_LABELS - add constraint FKf715qud6g9xv2xeb8rrpnv4xs - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; + add constraint FKrj80uilojn73u9a4xgk3vt0cj + foreign key (BLOCKING_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASKS - add constraint FK1693cbc36e4d8gucg8q7sc57e - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; + add constraint FK1693cbc36e4d8gucg8q7sc57e + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; alter table CCM_CORE.WORKFLOWS - add constraint FKrm2yfrs6veoxoy304upq2wc64 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKrm2yfrs6veoxoy304upq2wc64 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.WORKFLOWS - add constraint FK9ray5beiny6wm2mi0uwyecay2 - foreign key (TEMPLATE_ID) - references CCM_CORE.WORKFLOWS; \ No newline at end of file + add constraint FK9ray5beiny6wm2mi0uwyecay2 + foreign key (TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; \ No newline at end of file diff --git a/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/002_create_ccm_core_tables.sql b/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/002_create_ccm_core_tables.sql index a1b40403c..878286d56 100644 --- a/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/002_create_ccm_core_tables.sql +++ b/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/002_create_ccm_core_tables.sql @@ -1,12 +1,12 @@ create table CCM_CORE.APPLICATIONS ( - APPLICATION_TYPE varchar(1024) not null, + APPLICATION_TYPE varchar(1024) not null, PRIMARY_URL varchar(1024) not null, OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.ATTACHMENTS ( - ATTACHMENT_ID int8 not null, + ATTACHMENT_ID int8 not null, ATTACHMENT_DATA oid, DESCRIPTION varchar(255), MIME_TYPE varchar(255), @@ -16,10 +16,12 @@ ); create table CCM_CORE.CATEGORIES ( - ABSTRACT_CATEGORY boolean, + ABSTRACT_CATEGORY boolean, CATEGORY_ORDER int8, + DESCRIPTION jsonb, ENABLED boolean, NAME varchar(255) not null, + TITLE jsonb, UNIQUE_ID varchar(255), VISIBLE boolean, OBJECT_ID int8 not null, @@ -28,7 +30,7 @@ ); create table CCM_CORE.CATEGORIZATIONS ( - CATEGORIZATION_ID int8 not null, + CATEGORIZATION_ID int8 not null, CATEGORY_ORDER int8, CATEGORY_INDEX boolean, OBJECT_ORDER int8, @@ -39,16 +41,11 @@ primary key (CATEGORIZATION_ID) ); - create table CCM_CORE.CATEGORY_DESCRIPTIONS ( - OBJECT_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - create table CCM_CORE.CATEGORY_DOMAINS ( + DESCRIPTION jsonb, DOMAIN_KEY varchar(255) not null, RELEASED timestamp, + TITLE jsonb, URI varchar(1024), VERSION varchar(255), OBJECT_ID int8 not null, @@ -56,22 +53,15 @@ primary key (OBJECT_ID) ); - create table CCM_CORE.CATEGORY_TITLES ( - OBJECT_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - create table CCM_CORE.CCM_OBJECTS ( - OBJECT_ID int8 not null, + OBJECT_ID int8 not null, DISPLAY_NAME varchar(255), UUID varchar(255), primary key (OBJECT_ID) ); create table CCM_CORE.CCM_OBJECTS_AUD ( - OBJECT_ID int8 not null, + OBJECT_ID int8 not null, REV int4 not null, REVTYPE int2, REVEND int4, @@ -80,21 +70,22 @@ ); create table CCM_CORE.CCM_REVISIONS ( - id int4 not null, + id int4 not null, timestamp int8 not null, USER_NAME varchar(255), primary key (id) ); create table CCM_CORE.CCM_ROLES ( - ROLE_ID int8 not null, + ROLE_ID int8 not null, + DESCRIPTION jsonb, NAME varchar(512) not null, UUID varchar(255) not null, primary key (ROLE_ID) ); create table CCM_CORE.DIGESTS ( - FREQUENCY int4, + FREQUENCY int4, HEADER varchar(4096) not null, NEXT_RUN timestamp, DIGEST_SEPARATOR varchar(128) not null, @@ -105,15 +96,8 @@ primary key (OBJECT_ID) ); - create table CCM_CORE.DOMAIN_DESCRIPTIONS ( - OBJECT_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - create table CCM_CORE.DOMAIN_OWNERSHIPS ( - OWNERSHIP_ID int8 not null, + OWNERSHIP_ID int8 not null, CONTEXT varchar(255), DOMAIN_ORDER int8, OWNER_ORDER int8, @@ -123,25 +107,12 @@ primary key (OWNERSHIP_ID) ); - create table CCM_CORE.DOMAIN_TITLES ( - OBJECT_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - - create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( - COMPONENT_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (COMPONENT_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_COMPONENTS ( - ACTIVE boolean, + ACTIVE boolean, ADMIN_NAME varchar(255), ATTRIBUTE_STRING varchar(255), COMPONENT_ORDER int8, + DESCRIPTION jsonb, SELECTED boolean, OBJECT_ID int8 not null, parentComponent_OBJECT_ID int8, @@ -149,7 +120,7 @@ ); create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER ( - BODY text, + BODY text, FROM_EMAIL varchar(255), SUBJECT varchar(255), OBJECT_ID int8 not null, @@ -157,46 +128,34 @@ ); create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS ( - URL varchar(255), + URL varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS ( - MULTIPLE boolean, + MULTIPLE boolean, QUERY varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_DATA_QUERIES ( + DESCRIPTION jsonb, + QUERY_NAME jsonb, QUERY_ID varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( - DATA_QUERY_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (DATA_QUERY_ID, LOCALE) - ); - - create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( - DATA_QUERY_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (DATA_QUERY_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_FORMSECTIONS ( - FORMSECTION_ACTION varchar(255), + FORMSECTION_ACTION varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_LISTENERS ( - ATTRIBUTE_STRING varchar(255), + ATTRIBUTE_STRING varchar(255), CLASS_NAME varchar(255), OBJECT_ID int8 not null, widget_OBJECT_ID int8, @@ -204,7 +163,7 @@ ); create table CCM_CORE.FORMBUILDER_METAOBJECTS ( - CLASS_NAME varchar(255), + CLASS_NAME varchar(255), PRETTY_NAME varchar(255), PRETTY_PLURAL varchar(255), PROPERTIES_FORM varchar(255), @@ -213,41 +172,23 @@ ); create table CCM_CORE.FORMBUILDER_OBJECT_TYPES ( - APP_NAME varchar(255), + APP_NAME varchar(255), CLASS_NAME varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( - OPTION_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (OPTION_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_OPTIONS ( + LABEL jsonb, PARAMETER_VALUE varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( - PROCESS_LISTENER_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (PROCESS_LISTENER_ID, LOCALE) - ); - - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( - PROCESS_LISTENER_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (PROCESS_LISTENER_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( + DESCRIPTION jsonb, LISTENER_CLASS varchar(255), + LISTENER_NAME jsonb, PROCESS_LISTENER_ORDER int8, OBJECT_ID int8 not null, formSection_OBJECT_ID int8, @@ -255,20 +196,20 @@ ); create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER ( - REMOTE_URL varchar(2048), + REMOTE_URL varchar(2048), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS ( - RECIPIENT varchar(255), + RECIPIENT varchar(255), SUBJECT varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS ( - BODY text, + BODY text, RECIPIENT varchar(255), SUBJECT varchar(255), OBJECT_ID int8 not null, @@ -276,7 +217,7 @@ ); create table CCM_CORE.FORMBUILDER_WIDGETS ( - DEFAULT_VALUE varchar(255), + DEFAULT_VALUE varchar(255), PARAMETER_MODEL varchar(255), PARAMETER_NAME varchar(255), OBJECT_ID int8 not null, @@ -284,14 +225,14 @@ ); create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS ( - RECIPIENT varchar(255), + RECIPIENT varchar(255), SUBJECT varchar(255), OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.GROUP_MEMBERSHIPS ( - MEMBERSHIP_ID int8 not null, + MEMBERSHIP_ID int8 not null, UUID varchar(255) not null, GROUP_ID int8, MEMBER_ID int8, @@ -299,33 +240,33 @@ ); create table CCM_CORE.GROUPS ( - PARTY_ID int8 not null, + PARTY_ID int8 not null, primary key (PARTY_ID) ); create table CCM_CORE.HOSTS ( - HOST_ID int8 not null, + HOST_ID int8 not null, SERVER_NAME varchar(512), SERVER_PORT int8, primary key (HOST_ID) ); create table CCM_CORE.INITS ( - INITIALIZER_ID int8 not null, + INITIALIZER_ID int8 not null, CLASS_NAME varchar(255), REQUIRED_BY_ID int8, primary key (INITIALIZER_ID) ); create table CCM_CORE.INSTALLED_MODULES ( - MODULE_ID int4 not null, + MODULE_ID int4 not null, MODULE_CLASS_NAME varchar(2048), STATUS varchar(255), primary key (MODULE_ID) ); create table CCM_CORE.LUCENE_DOCUMENTS ( - DOCUMENT_ID int8 not null, + DOCUMENT_ID int8 not null, CONTENT text, CONTENT_SECTION varchar(512), COUNTRY varchar(8), @@ -344,14 +285,14 @@ ); create table CCM_CORE.LUCENE_INDEXES ( - INDEX_ID int8 not null, + INDEX_ID int8 not null, LUCENE_INDEX_ID int8, HOST_ID int8, primary key (INDEX_ID) ); create table CCM_CORE.MESSAGES ( - BODY varchar(255), + BODY varchar(255), BODY_MIME_TYPE varchar(255), SENT timestamp, SUBJECT varchar(255), @@ -362,7 +303,7 @@ ); create table CCM_CORE.NOTIFICATIONS ( - EXPAND_GROUP boolean, + EXPAND_GROUP boolean, EXPUNGE boolean, EXPUNGE_MESSAGE boolean, FULFILL_DATE timestamp, @@ -379,7 +320,7 @@ ); create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( - TOKEN_ID int8 not null, + TOKEN_ID int8 not null, PURPOSE varchar(255), TOKEN varchar(255), VALID_UNTIL timestamp, @@ -388,7 +329,7 @@ ); create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS ( - COMPONENT_MODEL_ID int8 not null, + COMPONENT_MODEL_ID int8 not null, CLASS_ATTRIBUTE varchar(512), ID_ATTRIBUTE varchar(255), COMPONENT_KEY varchar(255), @@ -400,7 +341,7 @@ ); create table CCM_CORE.PAGE_MODEL_CONTAINER_MODELS ( - CONTAINER_ID int8 not null, + CONTAINER_ID int8 not null, CONTAINER_UUID varchar(255) not null, CONTAINER_KEY varchar(255), UUID varchar(255) not null, @@ -409,25 +350,13 @@ primary key (CONTAINER_ID) ); - create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( - PAGE_MODEL_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (PAGE_MODEL_ID, LOCALE) - ); - - create table CCM_CORE.PAGE_MODEL_TITLES ( - PAGE_MODEL_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (PAGE_MODEL_ID, LOCALE) - ); - create table CCM_CORE.PAGE_MODELS ( - PAGE_MODEL_ID int8 not null, + PAGE_MODEL_ID int8 not null, + DESCRIPTION jsonb, LAST_MODIFIED timestamp, MODEL_UUID varchar(255) not null, NAME varchar(255), + TITLE jsonb, TYPE varchar(255) not null, UUID varchar(255) not null, VERSION varchar(255) not null, @@ -436,14 +365,14 @@ ); create table CCM_CORE.PARTIES ( - PARTY_ID int8 not null, + PARTY_ID int8 not null, NAME varchar(256) not null, UUID varchar(255) not null, primary key (PARTY_ID) ); create table CCM_CORE.PERMISSIONS ( - PERMISSION_ID int8 not null, + PERMISSION_ID int8 not null, CREATION_DATE timestamp, CREATION_IP varchar(255), GRANTED_PRIVILEGE varchar(255), @@ -457,13 +386,13 @@ ); create table CCM_CORE.PORTALS ( - TEMPLATE boolean, + TEMPLATE boolean, OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.PORTLETS ( - CELL_NUMBER int8, + CELL_NUMBER int8, SORT_KEY int8, OBJECT_ID int8 not null, PORTAL_ID int8, @@ -471,7 +400,7 @@ ); create table CCM_CORE.QUEUE_ITEMS ( - QUEUE_ITEM_ID int8 not null, + QUEUE_ITEM_ID int8 not null, HEADER varchar(4096), RECEIVER_ADDRESS varchar(512), RETRY_COUNT int8, @@ -482,29 +411,9 @@ primary key (QUEUE_ITEM_ID) ); - create table CCM_CORE.RESOURCE_DESCRIPTIONS ( - OBJECT_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - - create table CCM_CORE.RESOURCE_TITLES ( - OBJECT_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (OBJECT_ID, LOCALE) - ); - - create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( - RESOURCE_TYPE_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (RESOURCE_TYPE_ID, LOCALE) - ); - create table CCM_CORE.RESOURCE_TYPES ( - RESOURCE_TYPE_ID int8 not null, + RESOURCE_TYPE_ID int8 not null, + DESCRIPTION jsonb, SINGLETON boolean, TITLE varchar(254) not null, UUID varchar(255) not null, @@ -515,22 +424,17 @@ ); create table CCM_CORE.RESOURCES ( - CREATED timestamp, + CREATED timestamp, + DESCRIPTION jsonb, + TITLE jsonb, OBJECT_ID int8 not null, parent_OBJECT_ID int8, resourceType_RESOURCE_TYPE_ID int8, primary key (OBJECT_ID) ); - create table CCM_CORE.ROLE_DESCRIPTIONS ( - ROLE_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (ROLE_ID, LOCALE) - ); - create table CCM_CORE.ROLE_MEMBERSHIPS ( - MEMBERSHIP_ID int8 not null, + MEMBERSHIP_ID int8 not null, UUID varchar(255) not null, MEMBER_ID int8, ROLE_ID int8, @@ -538,43 +442,37 @@ ); create table CCM_CORE.SETTINGS ( - DTYPE varchar(31) not null, + DTYPE varchar(31) not null, SETTING_ID int8 not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, + SETTING_VALUE_DOUBLE float8, + SETTING_VALUE_BIG_DECIMAL numeric(19, 2), + SETTING_VALUE_LOCALIZED_STRING jsonb, SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_LONG int8, SETTING_VALUE_STRING varchar(1024), - SETTING_VALUE_DOUBLE float8, - SETTING_VALUE_BIG_DECIMAL numeric(19, 2), primary key (SETTING_ID) ); create table CCM_CORE.SETTINGS_ENUM_VALUES ( - ENUM_ID int8 not null, + ENUM_ID int8 not null, value varchar(255) ); - create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( - ENTRY_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (ENTRY_ID, LOCALE) - ); - create table CCM_CORE.SETTINGS_STRING_LIST ( - LIST_ID int8 not null, + LIST_ID int8 not null, value varchar(255) ); create table CCM_CORE.SITE_AWARE_APPLICATIONS ( - OBJECT_ID int8 not null, + OBJECT_ID int8 not null, SITE_ID int8, primary key (OBJECT_ID) ); create table CCM_CORE.SITES ( - DEFAULT_SITE boolean, + DEFAULT_SITE boolean, DEFAULT_THEME varchar(255), DOMAIN_OF_SITE varchar(255), OBJECT_ID int8 not null, @@ -582,7 +480,7 @@ ); create table CCM_CORE.STYLE_MEDIA_QUERIES ( - MEDIA_QUERY_ID int8 not null, + MEDIA_QUERY_ID int8 not null, MAX_WIDTH_UNIT varchar(255), MAX_WIDTH_VALUE float8, MEDIA_TYPE varchar(255), @@ -592,14 +490,14 @@ ); create table CCM_CORE.STYLE_MEDIA_RULES ( - MEDIA_RULE_ID int8 not null, + MEDIA_RULE_ID int8 not null, MEDIA_QUERY_ID int8, STYLE_ID int8, primary key (MEDIA_RULE_ID) ); create table CCM_CORE.STYLE_PROPERTIES ( - PROPERTY_ID int8 not null, + PROPERTY_ID int8 not null, NAME varchar(256), PROPERTY_VALUE varchar(4096), RULE_ID int8, @@ -607,20 +505,20 @@ ); create table CCM_CORE.STYLE_RULES ( - RULE_ID int8 not null, + RULE_ID int8 not null, SELECTOR varchar(2048), STYLE_ID int8, primary key (RULE_ID) ); create table CCM_CORE.STYLES ( - STYLE_ID int8 not null, + STYLE_ID int8 not null, STYLENAME varchar(255), primary key (STYLE_ID) ); create table CCM_CORE.THEME_DATA_FILES ( - CREATION_DATE timestamp, + CREATION_DATE timestamp, FILE_DATA oid, LAST_MODIFIED timestamp, FILE_SIZE int8, @@ -630,12 +528,12 @@ ); create table CCM_CORE.theme_directories ( - FILE_ID int8 not null, + FILE_ID int8 not null, primary key (FILE_ID) ); create table CCM_CORE.THEME_FILES ( - FILE_ID int8 not null, + FILE_ID int8 not null, NAME varchar(255) not null, FILE_PATH varchar(8192) not null, UUID varchar(255) not null, @@ -646,7 +544,7 @@ ); create table CCM_CORE.THEMES ( - THEME_ID int8 not null, + THEME_ID int8 not null, NAME varchar(255), UUID varchar(255), VERSION varchar(255), @@ -655,20 +553,20 @@ ); create table CCM_CORE.THREADS ( - OBJECT_ID int8 not null, + OBJECT_ID int8 not null, ROOT_ID int8, primary key (OBJECT_ID) ); create table CCM_CORE.USER_EMAIL_ADDRESSES ( - USER_ID int8 not null, + USER_ID int8 not null, EMAIL_ADDRESS varchar(512) not null, BOUNCING boolean, VERIFIED boolean ); create table CCM_CORE.USERS ( - BANNED boolean, + BANNED boolean, FAMILY_NAME varchar(512), GIVEN_NAME varchar(512), PASSWORD varchar(2048), @@ -681,7 +579,7 @@ ); create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS ( - DUE_DATE timestamp, + DUE_DATE timestamp, DURATION_MINUTES int8, LOCKED boolean, START_DATE timestamp, @@ -691,22 +589,8 @@ primary key (TASK_ID) ); - create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( - WORKFLOW_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (WORKFLOW_ID, LOCALE) - ); - - create table CCM_CORE.WORKFLOW_NAMES ( - WORKFLOW_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (WORKFLOW_ID, LOCALE) - ); - create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS ( - TASK_ASSIGNMENT_ID int8 not null, + TASK_ASSIGNMENT_ID int8 not null, UUID varchar(255) not null, ROLE_ID int8, TASK_ID int8, @@ -714,7 +598,7 @@ ); create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( - COMMENT_ID int8 not null, + COMMENT_ID int8 not null, COMMENT text, UUID varchar(255) not null, AUTHOR_ID int8, @@ -723,30 +607,18 @@ ); create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( - TASK_DEPENDENCY_ID int8 not null, + TASK_DEPENDENCY_ID int8 not null, uuid varchar(255) not null, BLOCKED_TASK_ID int8, BLOCKING_TASK_ID int8, primary key (TASK_DEPENDENCY_ID) ); - create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( - TASK_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (TASK_ID, LOCALE) - ); - - create table CCM_CORE.WORKFLOW_TASK_LABELS ( - TASK_ID int8 not null, - LOCALIZED_VALUE text, - LOCALE varchar(255) not null, - primary key (TASK_ID, LOCALE) - ); - create table CCM_CORE.WORKFLOW_TASKS ( - TASK_ID int8 not null, + TASK_ID int8 not null, ACTIVE boolean, + DESCRIPTION jsonb, + LABEL jsonb, TASK_STATE varchar(512), UUID varchar(255) not null, WORKFLOW_ID int8, @@ -754,9 +626,11 @@ ); create table CCM_CORE.WORKFLOWS ( - WORKFLOW_ID int8 not null, + WORKFLOW_ID int8 not null, abstract_workflow boolean, ACTIVE boolean, + DESCRIPTION jsonb, + NAME jsonb, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), UUID varchar(255) not null, @@ -766,647 +640,542 @@ ); alter table CCM_CORE.CATEGORIZATIONS - add constraint UK_da7jus3wn1tr8poyaw9btxbrc unique (UUID); + add constraint UK_da7jus3wn1tr8poyaw9btxbrc unique (UUID); alter table CCM_CORE.CATEGORY_DOMAINS - add constraint UK_mb1riernf8a88u3mwl0bgfj8y unique (DOMAIN_KEY); + add constraint UK_mb1riernf8a88u3mwl0bgfj8y unique (DOMAIN_KEY); alter table CCM_CORE.CATEGORY_DOMAINS - add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); + add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); alter table CCM_CORE.CCM_OBJECTS - add constraint UK_1cm71jlagvyvcnkqvxqyit3wx unique (UUID); + add constraint UK_1cm71jlagvyvcnkqvxqyit3wx unique (UUID); alter table CCM_CORE.CCM_ROLES - add constraint UK_rfmsjqsq6kagolsod3ufkugll unique (UUID); + add constraint UK_rfmsjqsq6kagolsod3ufkugll unique (UUID); alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint UK_j86gai9740v9hshascbsboudb unique (UUID); + add constraint UK_j86gai9740v9hshascbsboudb unique (UUID); alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint UK_kkdoia60bmiwhhdru169p3n9g unique (UUID); + add constraint UK_kkdoia60bmiwhhdru169p3n9g unique (UUID); alter table CCM_CORE.HOSTS - add constraint UK9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); + add constraint UK9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); alter table CCM_CORE.INSTALLED_MODULES - add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); + add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); alter table CCM_CORE.PARTIES - add constraint UK_1hv061qace2mn4loroe3fwdel unique (UUID); + add constraint UK_1hv061qace2mn4loroe3fwdel unique (UUID); alter table CCM_CORE.PERMISSIONS - add constraint UK_p50se7rdexv7xnkiqsl6ijyti unique (UUID); + add constraint UK_p50se7rdexv7xnkiqsl6ijyti unique (UUID); alter table CCM_CORE.RESOURCE_TYPES - add constraint UK_ioax2ix2xmq3nw7el5k6orggb unique (UUID); + add constraint UK_ioax2ix2xmq3nw7el5k6orggb unique (UUID); alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint UK_82wdq214bfs99eii71fp50s97 unique (UUID); + add constraint UK_82wdq214bfs99eii71fp50s97 unique (UUID); alter table CCM_CORE.SETTINGS - add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); + add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); alter table CCM_CORE.SITES - add constraint UK_kou1h4y4st2m173he44yy8grx unique (DOMAIN_OF_SITE); + add constraint UK_kou1h4y4st2m173he44yy8grx unique (DOMAIN_OF_SITE); alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS - add constraint UK_gv93k167pe9qy3go9vjau1q2t unique (UUID); + add constraint UK_gv93k167pe9qy3go9vjau1q2t unique (UUID); alter table CCM_CORE.WORKFLOW_TASK_COMMENTS - add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID); + add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID); alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES - add constraint UK_787va2ep8ucoul29qgsoaxnub unique (uuid); + add constraint UK_787va2ep8ucoul29qgsoaxnub unique (uuid); alter table CCM_CORE.WORKFLOW_TASKS - add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID); + add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID); alter table CCM_CORE.WORKFLOWS - add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); -create sequence hibernate_sequence start 100000 increment 1; + add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); +create sequence hibernate_sequence start 1 increment 1; alter table CCM_CORE.APPLICATIONS - add constraint FKatcp9ij6mbkx0nfeig1o6n3lm - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FKatcp9ij6mbkx0nfeig1o6n3lm + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.ATTACHMENTS - add constraint FK8ju9hm9baceridp803nislkwb - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; + add constraint FK8ju9hm9baceridp803nislkwb + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.CATEGORIES - add constraint FKrj3marx99nheur4fqanm0ylur - foreign key (PARENT_CATEGORY_ID) - references CCM_CORE.CATEGORIES; + add constraint FKrj3marx99nheur4fqanm0ylur + foreign key (PARENT_CATEGORY_ID) + references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORIES - add constraint FKpm291swli2musd0204phta652 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKpm291swli2musd0204phta652 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FKejp0ubk034nfq60v1po6srkke - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKejp0ubk034nfq60v1po6srkke + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FKoyeipswl876wa6mqwbx0uy83h - foreign key (CATEGORY_ID) - references CCM_CORE.CATEGORIES; - - alter table CCM_CORE.CATEGORY_DESCRIPTIONS - add constraint FKhiwjlmh5vkbu3v3vng1la1qum - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORIES; + add constraint FKoyeipswl876wa6mqwbx0uy83h + foreign key (CATEGORY_ID) + references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FKf25vi73cji01w8fgo6ow1dgg - foreign key (ROOT_CATEGORY_ID) - references CCM_CORE.CATEGORIES; + add constraint FKf25vi73cji01w8fgo6ow1dgg + foreign key (ROOT_CATEGORY_ID) + references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FK58xpmnvciohkom1c16oua4xha - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.CATEGORY_TITLES - add constraint FKka9bt9f5br0kji5bcjxcmf6ch - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORIES; + add constraint FK58xpmnvciohkom1c16oua4xha + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CCM_OBJECTS_AUD - add constraint FKr00eauutiyvocno8ckx6h9nw6 - foreign key (REV) - references CCM_CORE.CCM_REVISIONS; + add constraint FKr00eauutiyvocno8ckx6h9nw6 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; alter table CCM_CORE.CCM_OBJECTS_AUD - add constraint FKo5s37ctcdny7tmewjwv7705h5 - foreign key (REVEND) - references CCM_CORE.CCM_REVISIONS; + add constraint FKo5s37ctcdny7tmewjwv7705h5 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; alter table CCM_CORE.DIGESTS - add constraint FKc53g09agnye3w1v4euy3e0gsi - foreign key (FROM_PARTY_ID) - references CCM_CORE.PARTIES; + add constraint FKc53g09agnye3w1v4euy3e0gsi + foreign key (FROM_PARTY_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.DIGESTS - add constraint FK845r9ep6xu6nbt1mvxulwybym - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.DOMAIN_DESCRIPTIONS - add constraint FKn4i2dxgn8cqysa62dds6eih6a - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORY_DOMAINS; + add constraint FK845r9ep6xu6nbt1mvxulwybym + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK47nsasr7jrdwlky5gx0u6e9py - foreign key (domain_OBJECT_ID) - references CCM_CORE.CATEGORY_DOMAINS; + add constraint FK47nsasr7jrdwlky5gx0u6e9py + foreign key (domain_OBJECT_ID) + references CCM_CORE.CATEGORY_DOMAINS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK3u4hq6yqau4m419b1xva3xpwq - foreign key (owner_OBJECT_ID) - references CCM_CORE.APPLICATIONS; - - alter table CCM_CORE.DOMAIN_TITLES - add constraint FK5p526dsdwn94els6lp5w0hdn4 - foreign key (OBJECT_ID) - references CCM_CORE.CATEGORY_DOMAINS; - - alter table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS - add constraint FKfh0k9lj3pf4amfc9bbbss0tr1 - foreign key (COMPONENT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FK3u4hq6yqau4m419b1xva3xpwq + foreign key (owner_OBJECT_ID) + references CCM_CORE.APPLICATIONS; alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FKpcpmvyiix023b4g5n4q8nkfca - foreign key (parentComponent_OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FKpcpmvyiix023b4g5n4q8nkfca + foreign key (parentComponent_OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FKt0e0uv00pp1rwhyaltrytghnm - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKt0e0uv00pp1rwhyaltrytghnm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER - add constraint FK48khrbud3xhi2gvsvnlttd8tg - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FK48khrbud3xhi2gvsvnlttd8tg + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS - add constraint FKbyjjt2ufendvje2obtge2l7et - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKbyjjt2ufendvje2obtge2l7et + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS - add constraint FK8oriyta1957u7dvbrqk717944 - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_WIDGETS; + add constraint FK8oriyta1957u7dvbrqk717944 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_DATA_QUERIES - add constraint FKhhaxpeddbtmrnjr5o0fopju3a - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS - add constraint FKsmduu1opoiulkeo2gc8v7lsbn - foreign key (DATA_QUERY_ID) - references CCM_CORE.FORMBUILDER_DATA_QUERIES; - - alter table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES - add constraint FKju1x82inrw3kguyjuxoetn6gn - foreign key (DATA_QUERY_ID) - references CCM_CORE.FORMBUILDER_DATA_QUERIES; + add constraint FKhhaxpeddbtmrnjr5o0fopju3a + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_FORMSECTIONS - add constraint FKnfhsgxp4lvigq2pm33pn4afac - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FKnfhsgxp4lvigq2pm33pn4afac + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FK33ilyirwoux28yowafgd5xx0o - foreign key (widget_OBJECT_ID) - references CCM_CORE.FORMBUILDER_WIDGETS; + add constraint FK33ilyirwoux28yowafgd5xx0o + foreign key (widget_OBJECT_ID) + references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FKlqm76746nq5yrt8ganm474uu0 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKlqm76746nq5yrt8ganm474uu0 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_METAOBJECTS - add constraint FKf963v6u9mw8pwjmasrw51w8dx - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKf963v6u9mw8pwjmasrw51w8dx + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_OBJECT_TYPES - add constraint FKkv337e83rsecf0h3qy8bu7l9w - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.FORMBUILDER_OPTION_LABELS - add constraint FKatlsylsvln6yse55eof6wwkj6 - foreign key (OPTION_ID) - references CCM_CORE.FORMBUILDER_OPTIONS; + add constraint FKkv337e83rsecf0h3qy8bu7l9w + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_OPTIONS - add constraint FKhe5q71wby9g4i56sotc501h11 - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; - - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS - add constraint FKcv3iu04gxjk9c0pn6tl8rqqv3 - foreign key (PROCESS_LISTENER_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; - - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES - add constraint FK8rnyb1m6ij3b9hhmhr7klgd4p - foreign key (PROCESS_LISTENER_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKhe5q71wby9g4i56sotc501h11 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FK7uiaeax8qafm82e5k729ms5ku - foreign key (formSection_OBJECT_ID) - references CCM_CORE.FORMBUILDER_FORMSECTIONS; + add constraint FK7uiaeax8qafm82e5k729ms5ku + foreign key (formSection_OBJECT_ID) + references CCM_CORE.FORMBUILDER_FORMSECTIONS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FKbdnloo884qk6gn36jwiqv5rlp - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKbdnloo884qk6gn36jwiqv5rlp + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER - add constraint FKpajvu9m6fj1enm67a9gcb5ii9 - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKpajvu9m6fj1enm67a9gcb5ii9 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS - add constraint FKsn82ktlq0c9ikijyv8k2bfv4f - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKsn82ktlq0c9ikijyv8k2bfv4f + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS - add constraint FK8kjyu72btjsuaaqh4bvd8npns - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FK8kjyu72btjsuaaqh4bvd8npns + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_WIDGETS - add constraint FK1wosr4ujbfckdc50u5fgmrhrk - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; + add constraint FK1wosr4ujbfckdc50u5fgmrhrk + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS - add constraint FKjie9co03m7ow4ihig5rk7l8oj - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + add constraint FKjie9co03m7ow4ihig5rk7l8oj + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FKq4qnny8ri3eo7eqh4olxco8nk - foreign key (GROUP_ID) - references CCM_CORE.GROUPS; + add constraint FKq4qnny8ri3eo7eqh4olxco8nk + foreign key (GROUP_ID) + references CCM_CORE.GROUPS; alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FKc8u86ivkhvoiw6ju8b2p365he - foreign key (MEMBER_ID) - references CCM_CORE.USERS; + add constraint FKc8u86ivkhvoiw6ju8b2p365he + foreign key (MEMBER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.GROUPS - add constraint FK4f61mlqxw0ct6s7wwpi9m0735 - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; + add constraint FK4f61mlqxw0ct6s7wwpi9m0735 + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.INITS - add constraint FK3nvvxk10nmq9nfuko8yklqdgc - foreign key (REQUIRED_BY_ID) - references CCM_CORE.INITS; + add constraint FK3nvvxk10nmq9nfuko8yklqdgc + foreign key (REQUIRED_BY_ID) + references CCM_CORE.INITS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FK942kl4yff8rdiwr0pjk2a9g8 - foreign key (CREATED_BY_PARTY_ID) - references CCM_CORE.USERS; + add constraint FK942kl4yff8rdiwr0pjk2a9g8 + foreign key (CREATED_BY_PARTY_ID) + references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FKc5rs6afx4p9fidabfqsxr5ble - foreign key (LAST_MODIFIED_BY) - references CCM_CORE.USERS; + add constraint FKc5rs6afx4p9fidabfqsxr5ble + foreign key (LAST_MODIFIED_BY) + references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_INDEXES - add constraint FK6gu0yrlviqk07dtb3r02iw43f - foreign key (HOST_ID) - references CCM_CORE.HOSTS; + add constraint FK6gu0yrlviqk07dtb3r02iw43f + foreign key (HOST_ID) + references CCM_CORE.HOSTS; alter table CCM_CORE.MESSAGES - add constraint FKph10aehmg9f20pn2w4buki97q - foreign key (IN_REPLY_TO_ID) - references CCM_CORE.MESSAGES; + add constraint FKph10aehmg9f20pn2w4buki97q + foreign key (IN_REPLY_TO_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.MESSAGES - add constraint FKjufsx3c3h538fj35h8hgfnb1p - foreign key (SENDER_ID) - references CCM_CORE.USERS; + add constraint FKjufsx3c3h538fj35h8hgfnb1p + foreign key (SENDER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.MESSAGES - add constraint FK6w20ao7scwecd9mfwpun2ddqx - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FK6w20ao7scwecd9mfwpun2ddqx + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FKqk70c1x1dklhty9ju5t4wukd9 - foreign key (DIGEST_ID) - references CCM_CORE.DIGESTS; + add constraint FKqk70c1x1dklhty9ju5t4wukd9 + foreign key (DIGEST_ID) + references CCM_CORE.DIGESTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FKtt4fjr2p75og79jxxgd8q8mr - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; + add constraint FKtt4fjr2p75og79jxxgd8q8mr + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.NOTIFICATIONS - add constraint FK2vlnma0ox43j0clx8ead08n5s - foreign key (RECEIVER_ID) - references CCM_CORE.PARTIES; + add constraint FK2vlnma0ox43j0clx8ead08n5s + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.NOTIFICATIONS - add constraint FKf423hhiaw1bexpxeh1pnas7qt - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKf423hhiaw1bexpxeh1pnas7qt + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.ONE_TIME_AUTH_TOKENS - add constraint FKtplfuphkiorfkttaewb4wmfjc - foreign key (USER_ID) - references CCM_CORE.USERS; + add constraint FKtplfuphkiorfkttaewb4wmfjc + foreign key (USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS - add constraint FK1uvkayybawff8sqkmerqt60bk - foreign key (CONTAINER_ID) - references CCM_CORE.PAGE_MODEL_CONTAINER_MODELS; + add constraint FK1uvkayybawff8sqkmerqt60bk + foreign key (CONTAINER_ID) + references CCM_CORE.PAGE_MODEL_CONTAINER_MODELS; alter table CCM_CORE.PAGE_MODEL_CONTAINER_MODELS - add constraint FK1c6drneacxveol92vpum79fxb - foreign key (PAGE_MODEL_ID) - references CCM_CORE.PAGE_MODELS; + add constraint FK1c6drneacxveol92vpum79fxb + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; alter table CCM_CORE.PAGE_MODEL_CONTAINER_MODELS - add constraint FKoi5wphv3vtwryc19akku28p24 - foreign key (STYLE_ID) - references CCM_CORE.STYLES; - - alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS - add constraint FKcc5d6eqxu1369k8ycyyt6vn3e - foreign key (PAGE_MODEL_ID) - references CCM_CORE.PAGE_MODELS; - - alter table CCM_CORE.PAGE_MODEL_TITLES - add constraint FKj14q9911yhd4js9p6rs21rwjf - foreign key (PAGE_MODEL_ID) - references CCM_CORE.PAGE_MODELS; + add constraint FKoi5wphv3vtwryc19akku28p24 + foreign key (STYLE_ID) + references CCM_CORE.STYLES; alter table CCM_CORE.PAGE_MODELS - add constraint FKk2lihllrxj89mn3tqv43amafe - foreign key (APPLICATION_ID) - references CCM_CORE.APPLICATIONS; + add constraint FKk2lihllrxj89mn3tqv43amafe + foreign key (APPLICATION_ID) + references CCM_CORE.APPLICATIONS; alter table CCM_CORE.PERMISSIONS - add constraint FKj9di7pawxgtouxmu2k44bj5c4 - foreign key (CREATION_USER_ID) - references CCM_CORE.USERS; + add constraint FKj9di7pawxgtouxmu2k44bj5c4 + foreign key (CREATION_USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.PERMISSIONS - add constraint FKikx3x0kn9fito23g50v6xbr9f - foreign key (GRANTEE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKikx3x0kn9fito23g50v6xbr9f + foreign key (GRANTEE_ID) + references CCM_CORE.CCM_ROLES; alter table CCM_CORE.PERMISSIONS - add constraint FKg56ujjoe0j30pq579rf0l5yc6 - foreign key (INHERITED_FROM_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKg56ujjoe0j30pq579rf0l5yc6 + foreign key (INHERITED_FROM_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.PERMISSIONS - add constraint FKkamckexjnffnt8lay9nqeawhm - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKkamckexjnffnt8lay9nqeawhm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.PORTALS - add constraint FK5a2hdrbw03mmgr74vj5nxlpvk - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FK5a2hdrbw03mmgr74vj5nxlpvk + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.PORTLETS - add constraint FK9gr5xjt3rx4uhtw7vl6adruol - foreign key (PORTAL_ID) - references CCM_CORE.PORTALS; + add constraint FK9gr5xjt3rx4uhtw7vl6adruol + foreign key (PORTAL_ID) + references CCM_CORE.PORTALS; alter table CCM_CORE.PORTLETS - add constraint FKjmx9uebt0gwxkw3xv34niy35f - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FKjmx9uebt0gwxkw3xv34niy35f + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.QUEUE_ITEMS - add constraint FKtgkwfruv9kjdybf46l02da088 - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; + add constraint FKtgkwfruv9kjdybf46l02da088 + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.QUEUE_ITEMS - add constraint FKs9aq1hyxstwmvx7fmfifp4x7r - foreign key (RECEIVER_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.RESOURCE_DESCRIPTIONS - add constraint FKk9arvj5u21rv23ce3cav4opqx - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TITLES - add constraint FKto4p6n2wklljyf7tmuxtmyfe0 - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS - add constraint FKckpihjtv23iahbg3imnpbsr2 - foreign key (RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; + add constraint FKs9aq1hyxstwmvx7fmfifp4x7r + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.RESOURCES - add constraint FKbo7ibfgodicn9flv2gfo11g5a - foreign key (parent_OBJECT_ID) - references CCM_CORE.RESOURCES; + add constraint FKbo7ibfgodicn9flv2gfo11g5a + foreign key (parent_OBJECT_ID) + references CCM_CORE.RESOURCES; alter table CCM_CORE.RESOURCES - add constraint FK262fbwetpjx3k4uuvw24wsiv - foreign key (resourceType_RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; + add constraint FK262fbwetpjx3k4uuvw24wsiv + foreign key (resourceType_RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; alter table CCM_CORE.RESOURCES - add constraint FKbjdf8pm4frth8r06ev2qjm88f - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.ROLE_DESCRIPTIONS - add constraint FKo09bh4j3k3k0ph3awvjwx31ft - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKbjdf8pm4frth8r06ev2qjm88f + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FK9m88ywi7rcin7b7jrgh53emrq - foreign key (MEMBER_ID) - references CCM_CORE.PARTIES; + add constraint FK9m88ywi7rcin7b7jrgh53emrq + foreign key (MEMBER_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FKcsyogv5m2rgsrmtgnhgkjhfw7 - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKcsyogv5m2rgsrmtgnhgkjhfw7 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; alter table CCM_CORE.SETTINGS_ENUM_VALUES - add constraint FK8mw4p92s0h3h8bmo8saowu32i - foreign key (ENUM_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_L10N_STR_VALUES - add constraint FK5knjq7cisej0qfx5dw1y93rou - foreign key (ENTRY_ID) - references CCM_CORE.SETTINGS; + add constraint FK8mw4p92s0h3h8bmo8saowu32i + foreign key (ENUM_ID) + references CCM_CORE.SETTINGS; alter table CCM_CORE.SETTINGS_STRING_LIST - add constraint FKqeclqa5sf1g53vxs857tpwrus - foreign key (LIST_ID) - references CCM_CORE.SETTINGS; + add constraint FKqeclqa5sf1g53vxs857tpwrus + foreign key (LIST_ID) + references CCM_CORE.SETTINGS; alter table CCM_CORE.SITE_AWARE_APPLICATIONS - add constraint FKopo91c29jaunpcusjwlphhxkd - foreign key (SITE_ID) - references CCM_CORE.SITES; + add constraint FKopo91c29jaunpcusjwlphhxkd + foreign key (SITE_ID) + references CCM_CORE.SITES; alter table CCM_CORE.SITE_AWARE_APPLICATIONS - add constraint FKslbu2qagg23dmdu01lun7oh7x - foreign key (OBJECT_ID) - references CCM_CORE.APPLICATIONS; + add constraint FKslbu2qagg23dmdu01lun7oh7x + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; alter table CCM_CORE.SITES - add constraint FKrca95c6p023men53b8ayu26kp - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKrca95c6p023men53b8ayu26kp + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.STYLE_MEDIA_RULES - add constraint FKdq24a4atxp4c1sbqs8g6lpkx0 - foreign key (MEDIA_QUERY_ID) - references CCM_CORE.STYLE_MEDIA_QUERIES; + add constraint FKdq24a4atxp4c1sbqs8g6lpkx0 + foreign key (MEDIA_QUERY_ID) + references CCM_CORE.STYLE_MEDIA_QUERIES; alter table CCM_CORE.STYLE_MEDIA_RULES - add constraint FKf67h8q9kkjft9go2xo2572n17 - foreign key (STYLE_ID) - references CCM_CORE.STYLES; + add constraint FKf67h8q9kkjft9go2xo2572n17 + foreign key (STYLE_ID) + references CCM_CORE.STYLES; alter table CCM_CORE.STYLE_PROPERTIES - add constraint FKg2g0n7jmce3vjmula0898yp94 - foreign key (RULE_ID) - references CCM_CORE.STYLE_RULES; + add constraint FKg2g0n7jmce3vjmula0898yp94 + foreign key (RULE_ID) + references CCM_CORE.STYLE_RULES; alter table CCM_CORE.STYLE_RULES - add constraint FKf6fb4k6y2d74p70ldmj8awqj3 - foreign key (STYLE_ID) - references CCM_CORE.STYLE_MEDIA_RULES; + add constraint FKf6fb4k6y2d74p70ldmj8awqj3 + foreign key (STYLE_ID) + references CCM_CORE.STYLE_MEDIA_RULES; alter table CCM_CORE.THEME_DATA_FILES - add constraint FK630m2y2p7pp487ofowbefrm89 - foreign key (FILE_ID) - references CCM_CORE.THEME_FILES; + add constraint FK630m2y2p7pp487ofowbefrm89 + foreign key (FILE_ID) + references CCM_CORE.THEME_FILES; alter table CCM_CORE.theme_directories - add constraint FKrmgyslvw22j87n4cxau5jvsou - foreign key (FILE_ID) - references CCM_CORE.THEME_FILES; + add constraint FKrmgyslvw22j87n4cxau5jvsou + foreign key (FILE_ID) + references CCM_CORE.THEME_FILES; alter table CCM_CORE.THEME_FILES - add constraint FKfsycb4bt8d0wye7r3n06ekfeu - foreign key (PARENT_DIRECTORY_ID) - references CCM_CORE.theme_directories; + add constraint FKfsycb4bt8d0wye7r3n06ekfeu + foreign key (PARENT_DIRECTORY_ID) + references CCM_CORE.theme_directories; alter table CCM_CORE.THEME_FILES - add constraint FKke2jj04kjqh91h347g1ut0yff - foreign key (THEME_ID) - references CCM_CORE.THEMES; + add constraint FKke2jj04kjqh91h347g1ut0yff + foreign key (THEME_ID) + references CCM_CORE.THEMES; alter table CCM_CORE.THEMES - add constraint FKlat55c5l3fxbykkibrmv7qi4x - foreign key (ROOT_DIRECTORY_ID) - references CCM_CORE.theme_directories; + add constraint FKlat55c5l3fxbykkibrmv7qi4x + foreign key (ROOT_DIRECTORY_ID) + references CCM_CORE.theme_directories; alter table CCM_CORE.THREADS - add constraint FKsx08mpwvwnw97uwdgjs76q39g - foreign key (ROOT_ID) - references CCM_CORE.MESSAGES; + add constraint FKsx08mpwvwnw97uwdgjs76q39g + foreign key (ROOT_ID) + references CCM_CORE.MESSAGES; alter table CCM_CORE.THREADS - add constraint FKp97b1sy1kop07rtapeh5l9fb2 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKp97b1sy1kop07rtapeh5l9fb2 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.USER_EMAIL_ADDRESSES - add constraint FKr900l79erul95seyyccf04ufc - foreign key (USER_ID) - references CCM_CORE.USERS; + add constraint FKr900l79erul95seyyccf04ufc + foreign key (USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.USERS - add constraint FKosh928q71aonu6l1kurb417r - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; + add constraint FKosh928q71aonu6l1kurb417r + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS - add constraint FK1pnsq9ur3ylq0ghuj23p4cogs - foreign key (LOCKING_USER_ID) - references CCM_CORE.USERS; + add constraint FK1pnsq9ur3ylq0ghuj23p4cogs + foreign key (LOCKING_USER_ID) + references CCM_CORE.USERS; alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS - add constraint FK9ngp088m8xa82swy7yg3qx6vh - foreign key (NOTIFICATION_SENDER) - references CCM_CORE.USERS; + add constraint FK9ngp088m8xa82swy7yg3qx6vh + foreign key (NOTIFICATION_SENDER) + references CCM_CORE.USERS; alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS - add constraint FKt9ha3no3bj8a50pnw8cnqh2cq - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; - - alter table CCM_CORE.WORKFLOW_DESCRIPTIONS - add constraint FKgx7upkqky82dpxvbs95imfl9l - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_NAMES - add constraint FKkxedy9p48avfk45r0bn4uc09i - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; + add constraint FKt9ha3no3bj8a50pnw8cnqh2cq + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS - add constraint FKpq4paqtfbi5erhh98wl1ja005 - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; + add constraint FKpq4paqtfbi5erhh98wl1ja005 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS - add constraint FK3933ol31co3yn5ee75b2hmhgp - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; + add constraint FK3933ol31co3yn5ee75b2hmhgp + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; alter table CCM_CORE.WORKFLOW_TASK_COMMENTS - add constraint FKd2ymdg8nay9pmh2nn2whba0j8 - foreign key (AUTHOR_ID) - references CCM_CORE.USERS; + add constraint FKd2ymdg8nay9pmh2nn2whba0j8 + foreign key (AUTHOR_ID) + references CCM_CORE.USERS; alter table CCM_CORE.WORKFLOW_TASK_COMMENTS - add constraint FKkfqrf9jdvm7livu5if06w0r5t - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; + add constraint FKkfqrf9jdvm7livu5if06w0r5t + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES - add constraint FKy88tppv7ihx0lsn6g64f5lfq - foreign key (BLOCKED_TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; + add constraint FKy88tppv7ihx0lsn6g64f5lfq + foreign key (BLOCKED_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES - add constraint FKrj80uilojn73u9a4xgk3vt0cj - foreign key (BLOCKING_TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; - - alter table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS - add constraint FKeb7mqbdx3bk7t01vo7kp2hpf - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; - - alter table CCM_CORE.WORKFLOW_TASK_LABELS - add constraint FKf715qud6g9xv2xeb8rrpnv4xs - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_TASKS; + add constraint FKrj80uilojn73u9a4xgk3vt0cj + foreign key (BLOCKING_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; alter table CCM_CORE.WORKFLOW_TASKS - add constraint FK1693cbc36e4d8gucg8q7sc57e - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; + add constraint FK1693cbc36e4d8gucg8q7sc57e + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; alter table CCM_CORE.WORKFLOWS - add constraint FKrm2yfrs6veoxoy304upq2wc64 - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + add constraint FKrm2yfrs6veoxoy304upq2wc64 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.WORKFLOWS - add constraint FK9ray5beiny6wm2mi0uwyecay2 - foreign key (TEMPLATE_ID) - references CCM_CORE.WORKFLOWS; \ No newline at end of file + add constraint FK9ray5beiny6wm2mi0uwyecay2 + foreign key (TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; \ No newline at end of file