From 1624f24afdc7649b90ebc436458007ac55c50fd0 Mon Sep 17 00:00:00 2001 From: Wikum Weerakutti Date: Wed, 23 Oct 2024 16:29:37 +0530 Subject: [PATCH] TRUNK-6276: Fix ValidateHibernateMappingsDatabaseIT test errors when running with MySQL --- .github/workflows/build.yaml | 133 ++++++++++-------- .../java/org/openmrs/BaseOpenmrsMetadata.java | 3 +- .../java/org/openmrs/BaseOpenmrsObject.java | 2 +- .../main/java/org/openmrs/ConceptMapType.java | 5 + api/src/main/java/org/openmrs/Location.java | 6 +- .../org/openmrs/LocationAttributeType.java | 2 +- .../java/org/openmrs/MedicationDispense.java | 4 +- api/src/main/java/org/openmrs/OrderType.java | 1 - .../org/openmrs/PatientIdentifierType.java | 3 +- .../java/org/openmrs/PersonAttributeType.java | 2 + .../org/openmrs/ProgramAttributeType.java | 5 + .../org/openmrs/ProviderAttributeType.java | 2 +- .../java/org/openmrs/VisitAttributeType.java | 2 +- .../org/openmrs/api/db/SerializedObject.java | 9 +- .../openmrs/attribute/BaseAttributeType.java | 4 +- .../java/org/openmrs/hl7/HL7QueueItem.java | 3 +- .../api/db/hibernate/AllergyReaction.hbm.xml | 4 +- .../api/db/hibernate/CareSetting.hbm.xml | 5 +- .../db/hibernate/ClobDatatypeStorage.hbm.xml | 5 +- .../openmrs/api/db/hibernate/Cohort.hbm.xml | 9 +- .../api/db/hibernate/CohortMembership.hbm.xml | 5 +- .../openmrs/api/db/hibernate/Concept.hbm.xml | 5 +- .../api/db/hibernate/ConceptAnswer.hbm.xml | 7 +- .../api/db/hibernate/ConceptAttribute.hbm.xml | 6 +- .../db/hibernate/ConceptAttributeType.hbm.xml | 6 +- .../api/db/hibernate/ConceptClass.hbm.xml | 5 +- .../api/db/hibernate/ConceptDatatype.hbm.xml | 7 +- .../db/hibernate/ConceptDescription.hbm.xml | 6 +- .../api/db/hibernate/ConceptMap.hbm.xml | 6 +- .../api/db/hibernate/ConceptName.hbm.xml | 4 +- .../api/db/hibernate/ConceptNameTag.hbm.xml | 8 +- .../api/db/hibernate/ConceptProposal.hbm.xml | 7 +- .../db/hibernate/ConceptReferenceTerm.hbm.xml | 6 +- .../hibernate/ConceptReferenceTermMap.hbm.xml | 6 +- .../api/db/hibernate/ConceptSet.hbm.xml | 7 +- .../api/db/hibernate/ConceptSource.hbm.xml | 9 +- .../hibernate/ConceptStateConversion.hbm.xml | 11 +- .../api/db/hibernate/ConceptStopWord.hbm.xml | 4 +- .../db/hibernate/DiagnosisAttribute.hbm.xml | 4 +- .../hibernate/DiagnosisAttributeType.hbm.xml | 4 +- .../org/openmrs/api/db/hibernate/Drug.hbm.xml | 5 +- .../api/db/hibernate/DrugReferenceMap.hbm.xml | 6 +- .../db/hibernate/EncounterProvider.hbm.xml | 7 +- .../api/db/hibernate/EncounterRole.hbm.xml | 5 +- .../api/db/hibernate/EncounterType.hbm.xml | 7 +- .../openmrs/api/db/hibernate/Field.hbm.xml | 13 +- .../api/db/hibernate/FieldType.hbm.xml | 8 +- .../org/openmrs/api/db/hibernate/Form.hbm.xml | 9 +- .../api/db/hibernate/FormField.hbm.xml | 9 +- .../api/db/hibernate/FormResource.hbm.xml | 4 +- .../api/db/hibernate/GlobalProperty.hbm.xml | 9 +- .../db/hibernate/LocationAttribute.hbm.xml | 6 +- .../api/db/hibernate/LocationTag.hbm.xml | 4 +- .../api/db/hibernate/LoginCredential.hbm.xml | 8 +- .../org/openmrs/api/db/hibernate/Obs.hbm.xml | 7 +- .../openmrs/api/db/hibernate/Order.hbm.xml | 7 +- .../api/db/hibernate/OrderAttribute.hbm.xml | 4 +- .../db/hibernate/OrderAttributeType.hbm.xml | 4 +- .../api/db/hibernate/OrderFrequency.hbm.xml | 7 +- .../api/db/hibernate/OrderGroup.hbm.xml | 7 +- .../db/hibernate/OrderGroupAttribute.hbm.xml | 5 +- .../hibernate/OrderGroupAttributeType.hbm.xml | 5 +- .../openmrs/api/db/hibernate/OrderSet.hbm.xml | 5 +- .../db/hibernate/OrderSetAttribute.hbm.xml | 7 +- .../hibernate/OrderSetAttributeType.hbm.xml | 7 +- .../api/db/hibernate/OrderSetMember.hbm.xml | 5 +- .../db/hibernate/PatientIdentifier.hbm.xml | 5 +- .../api/db/hibernate/PatientProgram.hbm.xml | 7 +- .../hibernate/PatientProgramAttribute.hbm.xml | 7 +- .../openmrs/api/db/hibernate/Person.hbm.xml | 7 +- .../api/db/hibernate/PersonAttribute.hbm.xml | 5 +- .../api/db/hibernate/PersonMergeLog.hbm.xml | 7 +- .../api/db/hibernate/PersonName.hbm.xml | 5 +- .../api/db/hibernate/Privilege.hbm.xml | 9 +- .../openmrs/api/db/hibernate/Program.hbm.xml | 11 +- .../api/db/hibernate/ProgramWorkflow.hbm.xml | 9 +- .../db/hibernate/ProgramWorkflowState.hbm.xml | 11 +- .../openmrs/api/db/hibernate/Provider.hbm.xml | 5 +- .../db/hibernate/ProviderAttribute.hbm.xml | 7 +- .../api/db/hibernate/RelationshipType.hbm.xml | 5 +- .../org/openmrs/api/db/hibernate/Role.hbm.xml | 5 +- .../api/db/hibernate/VisitAttribute.hbm.xml | 7 +- .../api/db/hibernate/VisitType.hbm.xml | 5 +- .../hl7/db/hibernate/HL7InArchive.hbm.xml | 9 +- .../hl7/db/hibernate/HL7InQueue.hbm.xml | 19 +-- .../hl7/db/hibernate/HL7Source.hbm.xml | 11 +- .../liquibase-update-to-latest-2.7.x.xml | 114 ++++++++++++++- .../notification/db/hibernate/Alert.hbm.xml | 7 +- .../db/hibernate/Template.hbm.xml | 7 +- .../db/hibernate/TaskDefinition.hbm.xml | 20 +-- .../util/DatabaseUpdaterDatabaseIT.java | 2 +- 91 files changed, 529 insertions(+), 279 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 29bf44bd4039..17c6f17f2e1b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,63 +3,84 @@ name: Build with Maven # trigger build on branches that *should* support both Java 8 and Java 11 on: - push: - branches: - - master - - 2.4.x - - 2.5.x - - 2.6.x - pull_request: - branches: - - master - - 2.4.x - - 2.5.x - - 2.6.x - workflow_dispatch: + push: + branches: + - master + - 2.4.x + - 2.5.x + - 2.6.x + pull_request: + branches: + - master + - 2.4.x + - 2.5.x + - 2.6.x + workflow_dispatch: permissions: read-all jobs: - build: - strategy: - matrix: - platform: - - ubuntu-latest - java-version: - - 8 - - 11 - - 17 - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v4 - - name: Setup JDK - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: ${{ matrix.java-version }} - cache: 'maven' - - name: Install dependencies - run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --file pom.xml - - name: Build with Maven - run: mvn clean install --batch-mode && mvn test -Pskip-default-test -Pintegration-test --batch-mode --file pom.xml - # this is necessary to populate the environment variables for Coveralls properly - - name: Set branch name and PR number - id: refs - if: ${{ matrix.java-version == '8' }} - continue-on-error: true - env: - BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} - run: | - echo "::set-output name=branch_name::${BRANCH_NAME_OR_REF#refs/heads/}" - echo "::set-output name=pr_number::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" - - name: Update coverage data - # only send coverage data for Java 8 - if: ${{ matrix.java-version == '8' && steps.refs.outcome == 'success' }} - continue-on-error: true - env: - CI_NAME: Github - CI_BUILD_NUMBER: ${{ github.run_id }} - CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks - CI_BRANCH: ${{ steps.refs.outputs.branch_name }} - CI_PULL_REQUEST: ${{ steps.refs.outputs.pr_number }} - run: mvn jacoco:report coveralls:report --batch-mode --file pom.xml --no-transfer-progress -DrepoToken=${{ secrets.COVERALLS_TOKEN }} + build: + strategy: + matrix: + platform: + - ubuntu-latest + java-version: + - 8 + - 11 + - 17 + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v4 + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java-version }} + cache: 'maven' + - name: Install dependencies + run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --file pom.xml + - name: Build with Maven + run: mvn clean install --batch-mode && mvn test -Pskip-default-test -Pintegration-test --batch-mode --file pom.xml + # this is necessary to populate the environment variables for Coveralls properly + - name: Set branch name and PR number + id: refs + if: ${{ matrix.java-version == '8' }} + continue-on-error: true + env: + BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} + run: | + echo "::set-output name=branch_name::${BRANCH_NAME_OR_REF#refs/heads/}" + echo "::set-output name=pr_number::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" + - name: Update coverage data + # only send coverage data for Java 8 + if: ${{ matrix.java-version == '8' && steps.refs.outcome == 'success' }} + continue-on-error: true + env: + CI_NAME: Github + CI_BUILD_NUMBER: ${{ github.run_id }} + CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks + CI_BRANCH: ${{ steps.refs.outputs.branch_name }} + CI_PULL_REQUEST: ${{ steps.refs.outputs.pr_number }} + run: mvn jacoco:report coveralls:report --batch-mode --file pom.xml --no-transfer-progress -DrepoToken=${{ secrets.COVERALLS_TOKEN }} + + build_with_mysql: + strategy: + matrix: + platform: + - ubuntu-latest + java-version: + - 8 + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v4 + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java-version }} + cache: 'maven' + - name: Install dependencies + run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --file pom.xml + - name: Build with Maven with external database + run: mvn clean install --batch-mode && mvn test -DuseInMemoryDatabase=false -Pskip-default-test -Pintegration-test --batch-mode --file pom.xml diff --git a/api/src/main/java/org/openmrs/BaseOpenmrsMetadata.java b/api/src/main/java/org/openmrs/BaseOpenmrsMetadata.java index 664379ecb89e..fe7bda311f69 100644 --- a/api/src/main/java/org/openmrs/BaseOpenmrsMetadata.java +++ b/api/src/main/java/org/openmrs/BaseOpenmrsMetadata.java @@ -13,6 +13,7 @@ import javax.persistence.Column; import javax.persistence.JoinColumn; +import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; @@ -38,7 +39,7 @@ public abstract class BaseOpenmrsMetadata extends BaseOpenmrsObject implements O @Field private String name; - @Column(name = "description", length = 255) + @Column(name = "description") private String description; @ManyToOne(optional = false) diff --git a/api/src/main/java/org/openmrs/BaseOpenmrsObject.java b/api/src/main/java/org/openmrs/BaseOpenmrsObject.java index bb77af4a44b0..7c9458fb7fbe 100644 --- a/api/src/main/java/org/openmrs/BaseOpenmrsObject.java +++ b/api/src/main/java/org/openmrs/BaseOpenmrsObject.java @@ -28,7 +28,7 @@ @Audited public abstract class BaseOpenmrsObject implements Serializable, OpenmrsObject { - @Column(name = "uuid", unique = true, nullable = false, length = 38, updatable = false) + @Column(name = "uuid", unique = true, nullable = false, length = 38, updatable = false, columnDefinition = "char") private String uuid = UUID.randomUUID().toString(); /** diff --git a/api/src/main/java/org/openmrs/ConceptMapType.java b/api/src/main/java/org/openmrs/ConceptMapType.java index 323b3f3f2ec7..ca05c473dc84 100644 --- a/api/src/main/java/org/openmrs/ConceptMapType.java +++ b/api/src/main/java/org/openmrs/ConceptMapType.java @@ -12,6 +12,8 @@ import org.codehaus.jackson.annotate.JsonIgnore; import org.hibernate.envers.Audited; +import javax.persistence.AttributeOverride; +import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -28,6 +30,9 @@ @Entity @Table(name = "concept_map_type") @Audited +@AttributeOverrides(value = { + @AttributeOverride(name = "description", column = @Column(name = "description", columnDefinition = "varchar(255)", length = 255)), +}) public class ConceptMapType extends BaseChangeableOpenmrsMetadata { private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/org/openmrs/Location.java b/api/src/main/java/org/openmrs/Location.java index ed5f00ddc52a..8a1146578c58 100644 --- a/api/src/main/java/org/openmrs/Location.java +++ b/api/src/main/java/org/openmrs/Location.java @@ -18,6 +18,7 @@ import org.openmrs.api.context.Context; import javax.persistence.AttributeOverride; +import javax.persistence.AttributeOverrides; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -47,7 +48,10 @@ @Entity @Table(name = "location") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) -@AttributeOverride(name = "attributes", column = @Column(name = "location_id")) +@AttributeOverrides(value = { + @AttributeOverride(name = "attributes", column = @Column(name = "location_id")), + @AttributeOverride(name = "description", column = @Column(name = "description", columnDefinition = "varchar(255)", length = 255)) +}) @Audited public class Location extends BaseCustomizableMetadata implements java.io.Serializable, Attributable, Address { diff --git a/api/src/main/java/org/openmrs/LocationAttributeType.java b/api/src/main/java/org/openmrs/LocationAttributeType.java index d5cd04e180b0..c2220ee7aee3 100644 --- a/api/src/main/java/org/openmrs/LocationAttributeType.java +++ b/api/src/main/java/org/openmrs/LocationAttributeType.java @@ -33,7 +33,7 @@ @Table(name = "location_attribute_type") @Audited @AttributeOverrides(value = { - @AttributeOverride(name = "description", column = @Column(name = "description", length = 1024)) + @AttributeOverride(name = "description", column = @Column(name = "description", length = 1024, columnDefinition = "varchar(1024)")) }) public class LocationAttributeType extends BaseAttributeType implements AttributeType { diff --git a/api/src/main/java/org/openmrs/MedicationDispense.java b/api/src/main/java/org/openmrs/MedicationDispense.java index 5ae4c853859e..24c719a8892d 100644 --- a/api/src/main/java/org/openmrs/MedicationDispense.java +++ b/api/src/main/java/org/openmrs/MedicationDispense.java @@ -15,6 +15,7 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; +import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; import java.util.Date; @@ -191,7 +192,8 @@ public class MedicationDispense extends BaseFormRecordableOpenmrsData { * FHIR:DosageInstructions.patientInstructions * Relates to drugOrder.dosingInstructions */ - @Column(name = "dosing_instructions", length=65535) + @Column(name = "dosing_instructions", columnDefinition = "text") + @Lob private String dosingInstructions; /** diff --git a/api/src/main/java/org/openmrs/OrderType.java b/api/src/main/java/org/openmrs/OrderType.java index d24a573c0ef0..328d5e9d0989 100644 --- a/api/src/main/java/org/openmrs/OrderType.java +++ b/api/src/main/java/org/openmrs/OrderType.java @@ -30,7 +30,6 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.UniqueConstraint; -import java.util.Collection; import java.util.LinkedHashSet; import java.util.Set; diff --git a/api/src/main/java/org/openmrs/PatientIdentifierType.java b/api/src/main/java/org/openmrs/PatientIdentifierType.java index f54e26e12aa9..1df2b0e2dd1d 100644 --- a/api/src/main/java/org/openmrs/PatientIdentifierType.java +++ b/api/src/main/java/org/openmrs/PatientIdentifierType.java @@ -10,6 +10,7 @@ package org.openmrs; import org.apache.commons.lang3.StringUtils; +import org.checkerframework.checker.units.qual.C; import org.hibernate.annotations.GenericGenerator; import org.hibernate.envers.Audited; import org.hibernate.search.annotations.DocumentId; @@ -32,7 +33,7 @@ @Table(name = "patient_identifier_type") @Audited @AttributeOverrides({ - @AttributeOverride(name = "name", column = @Column(name = "name", nullable = false, length = 50)) + @AttributeOverride(name = "name", column = @Column(name = "name", nullable = false, length = 50)), }) public class PatientIdentifierType extends BaseChangeableOpenmrsMetadata { diff --git a/api/src/main/java/org/openmrs/PersonAttributeType.java b/api/src/main/java/org/openmrs/PersonAttributeType.java index 9e740f76e258..ce37486bfe81 100644 --- a/api/src/main/java/org/openmrs/PersonAttributeType.java +++ b/api/src/main/java/org/openmrs/PersonAttributeType.java @@ -14,6 +14,8 @@ import org.hibernate.search.annotations.Field; import org.openmrs.util.OpenmrsUtil; +import javax.persistence.AttributeOverride; +import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/api/src/main/java/org/openmrs/ProgramAttributeType.java b/api/src/main/java/org/openmrs/ProgramAttributeType.java index fd5a49608ccb..35901cf5f455 100644 --- a/api/src/main/java/org/openmrs/ProgramAttributeType.java +++ b/api/src/main/java/org/openmrs/ProgramAttributeType.java @@ -16,6 +16,8 @@ import org.openmrs.attribute.AttributeType; import org.openmrs.attribute.BaseAttributeType; +import javax.persistence.AttributeOverride; +import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -26,6 +28,9 @@ @Entity @Table(name = "program_attribute_type") @Audited +@AttributeOverrides(value = { + @AttributeOverride(name = "description", column = @Column(name = "description", columnDefinition = "varchar(1024)", length = 1024)) +}) public class ProgramAttributeType extends BaseAttributeType implements AttributeType { @Id diff --git a/api/src/main/java/org/openmrs/ProviderAttributeType.java b/api/src/main/java/org/openmrs/ProviderAttributeType.java index d2d6f893226b..a0b9066d4be0 100644 --- a/api/src/main/java/org/openmrs/ProviderAttributeType.java +++ b/api/src/main/java/org/openmrs/ProviderAttributeType.java @@ -31,7 +31,7 @@ @Table(name = "provider_attribute_type") @Audited @AttributeOverrides(value = { - @AttributeOverride(name = "description", column = @Column(name = "description", length = 1024)) + @AttributeOverride(name = "description", column = @Column(name = "description", columnDefinition = "varchar(1024)", length = 1024 )) }) public class ProviderAttributeType extends BaseAttributeType implements AttributeType { diff --git a/api/src/main/java/org/openmrs/VisitAttributeType.java b/api/src/main/java/org/openmrs/VisitAttributeType.java index db23e4d99f87..2266cfc61449 100644 --- a/api/src/main/java/org/openmrs/VisitAttributeType.java +++ b/api/src/main/java/org/openmrs/VisitAttributeType.java @@ -30,7 +30,7 @@ @Table(name = "visit_attribute_type") @Audited @AttributeOverrides(value = { - @AttributeOverride(name = "description", column = @Column(name = "description", length = 1024)) + @AttributeOverride(name = "description", column = @Column(name = "description", columnDefinition = "varchar(1024)", length = 1024)) }) public class VisitAttributeType extends BaseAttributeType implements AttributeType { diff --git a/api/src/main/java/org/openmrs/api/db/SerializedObject.java b/api/src/main/java/org/openmrs/api/db/SerializedObject.java index 7c0aff5026a8..8f349f81a77b 100644 --- a/api/src/main/java/org/openmrs/api/db/SerializedObject.java +++ b/api/src/main/java/org/openmrs/api/db/SerializedObject.java @@ -15,11 +15,14 @@ import org.openmrs.BaseChangeableOpenmrsMetadata; import org.openmrs.serialization.OpenmrsSerializer; +import javax.persistence.AttributeOverride; +import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Lob; import javax.persistence.Table; /** @@ -28,6 +31,9 @@ @Entity @Table(name = "serialized_object") @Audited +@AttributeOverrides(value = { + @AttributeOverride(name = "description", column = @Column(name = "description", columnDefinition = "varchar(1024)", length = 5000)) +}) public class SerializedObject extends BaseChangeableOpenmrsMetadata { @Id @@ -49,7 +55,8 @@ public class SerializedObject extends BaseChangeableOpenmrsMetadata { @Column(name = "serialization_class", nullable = false, length = 255) private Class serializationClass; - @Column(name = "serialized_data", length = 16777215) + @Column(name = "serialized_data", columnDefinition = "mediumtext") + @Lob private String serializedData; /** diff --git a/api/src/main/java/org/openmrs/attribute/BaseAttributeType.java b/api/src/main/java/org/openmrs/attribute/BaseAttributeType.java index 06f3af5ea2ea..2d782a398793 100644 --- a/api/src/main/java/org/openmrs/attribute/BaseAttributeType.java +++ b/api/src/main/java/org/openmrs/attribute/BaseAttributeType.java @@ -35,14 +35,14 @@ public abstract class BaseAttributeType> exte @Column(name = "datatype", length = 255) private String datatypeClassname; - @Column(name = "datatype_config", length = 65535 ) + @Column(name = "datatype_config", columnDefinition = "text") @Lob private String datatypeConfig; @Column(name = "preferred_handler", length = 255) private String preferredHandlerClassname; - @Column(name = "handler_config", length = 65535 ) + @Column(name = "handler_config", columnDefinition = "text") @Lob private String handlerConfig; diff --git a/api/src/main/java/org/openmrs/hl7/HL7QueueItem.java b/api/src/main/java/org/openmrs/hl7/HL7QueueItem.java index 087bf00451f0..7153e24a2543 100644 --- a/api/src/main/java/org/openmrs/hl7/HL7QueueItem.java +++ b/api/src/main/java/org/openmrs/hl7/HL7QueueItem.java @@ -36,7 +36,8 @@ public abstract class HL7QueueItem extends BaseOpenmrsObject { @JoinColumn(name = "hl7_source") private HL7Source hl7Source; - @Column(name = "hl7_source_key", length = 1024) + @Column(name = "hl7_source_key", columnDefinition = "text") + @Lob private String hl7SourceKey; @Column(name = "hl7_data", nullable = false, columnDefinition = "text") diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/AllergyReaction.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/AllergyReaction.hbm.xml index 087d9d966074..4333db576248 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/AllergyReaction.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/AllergyReaction.hbm.xml @@ -25,6 +25,8 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/CareSetting.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/CareSetting.hbm.xml index 755c8d937720..2c2591b9cbbc 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/CareSetting.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/CareSetting.hbm.xml @@ -38,8 +38,9 @@ column="date_created" not-null="true" length="19" /> - + + + clob_datatype_storage_id_seq - - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/Cohort.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/Cohort.hbm.xml index 56f0a9c2cd2a..1155f95e5f4f 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/Cohort.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/Cohort.hbm.xml @@ -26,9 +26,10 @@ not-null="true" length="255" /> - - + + + + @@ -52,4 +53,4 @@ - \ No newline at end of file + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/CohortMembership.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/CohortMembership.hbm.xml index ddf4ab656690..e0a32c47522d 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/CohortMembership.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/CohortMembership.hbm.xml @@ -38,8 +38,9 @@ column="date_voided" length="19" /> - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/Concept.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/Concept.hbm.xml index de92ea7a6f11..cfb2a8c47e17 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/Concept.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/Concept.hbm.xml @@ -27,8 +27,9 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAnswer.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAnswer.hbm.xml index 73f2e7d35f29..a68af64d61aa 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAnswer.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAnswer.hbm.xml @@ -37,10 +37,11 @@ name="answerDrug" class="org.openmrs.Drug" column="answer_drug" /> - - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttribute.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttribute.hbm.xml index 2b9295ec5861..7571df38f425 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttribute.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttribute.hbm.xml @@ -47,8 +47,10 @@ - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttributeType.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttributeType.hbm.xml index c211b12eaff7..1233911613a0 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttributeType.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttributeType.hbm.xml @@ -57,8 +57,10 @@ - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptClass.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptClass.hbm.xml index 9310f66fe2a2..a23a86da930c 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptClass.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptClass.hbm.xml @@ -25,8 +25,9 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDatatype.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDatatype.hbm.xml index 7fab8cb03166..7a18c114b6c2 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDatatype.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDatatype.hbm.xml @@ -24,9 +24,10 @@ concept_datatype_concept_datatype_id_seq - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDescription.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDescription.hbm.xml index d78a95c179dd..63e2c8f838f0 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDescription.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptDescription.hbm.xml @@ -29,14 +29,16 @@ class="Concept" not-null="true"/> - + - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptMap.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptMap.hbm.xml index f4b21722e7c4..f1c7bbb70e98 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptMap.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptMap.hbm.xml @@ -22,8 +22,10 @@ concept_reference_map_concept_map_id_seq - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptName.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptName.hbm.xml index aeb2e83f422d..aa9c0b90dbfc 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptName.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptName.hbm.xml @@ -57,7 +57,9 @@ - + + + - + @@ -36,8 +36,10 @@ - - + + + + concept_proposal_concept_proposal_id_seq - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTerm.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTerm.hbm.xml index 064ccd28e4f4..6b098ac17193 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTerm.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTerm.hbm.xml @@ -23,8 +23,10 @@ concept_reference_term_concept_reference_term_id_seq - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTermMap.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTermMap.hbm.xml index bf4010e0c3f7..b52a68a653af 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTermMap.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptReferenceTermMap.hbm.xml @@ -23,8 +23,10 @@ concept_reference_term_map_concept_reference_term_map_id_seq - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSet.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSet.hbm.xml index bd2f7f92d42a..53e09b16d897 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSet.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSet.hbm.xml @@ -22,9 +22,10 @@ concept_set_concept_set_id_seq - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSource.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSource.hbm.xml index e07f93baed6b..765e4246a975 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSource.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptSource.hbm.xml @@ -23,13 +23,14 @@ - + + + - + concept_state_conversion_concept_state_conversion_id_seq - - - - + + + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptStopWord.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptStopWord.hbm.xml index 10577889bc0f..fb62b0f8a2a4 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptStopWord.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/ConceptStopWord.hbm.xml @@ -27,7 +27,9 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttribute.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttribute.hbm.xml index e6ad2acbb646..1a3732687721 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttribute.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttribute.hbm.xml @@ -46,7 +46,9 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttributeType.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttributeType.hbm.xml index b4a7022919d3..aead4a946213 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttributeType.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/DiagnosisAttributeType.hbm.xml @@ -56,7 +56,9 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/Drug.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/Drug.hbm.xml index dfbf404db43c..d09a0a731c9a 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/Drug.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/Drug.hbm.xml @@ -59,8 +59,9 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/Role.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/Role.hbm.xml index 0db83faf8626..b4019eb67e82 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/Role.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/Role.hbm.xml @@ -23,8 +23,9 @@ - + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/VisitAttribute.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/VisitAttribute.hbm.xml index e063dbec9515..d740cb11292c 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/VisitAttribute.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/VisitAttribute.hbm.xml @@ -47,9 +47,10 @@ - - - + + + + diff --git a/api/src/main/resources/org/openmrs/api/db/hibernate/VisitType.hbm.xml b/api/src/main/resources/org/openmrs/api/db/hibernate/VisitType.hbm.xml index 5c7719e18ee8..15472511dedc 100644 --- a/api/src/main/resources/org/openmrs/api/db/hibernate/VisitType.hbm.xml +++ b/api/src/main/resources/org/openmrs/api/db/hibernate/VisitType.hbm.xml @@ -26,8 +26,9 @@ - - + + + diff --git a/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InArchive.hbm.xml b/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InArchive.hbm.xml index 315ff172e9ff..bad18bb1187d 100644 --- a/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InArchive.hbm.xml +++ b/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InArchive.hbm.xml @@ -32,7 +32,7 @@ - - - + + + + diff --git a/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InQueue.hbm.xml b/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InQueue.hbm.xml index 27bd5a6c046f..e3edcce21315 100644 --- a/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InQueue.hbm.xml +++ b/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7InQueue.hbm.xml @@ -29,22 +29,23 @@ - + - + - + - - + + + + diff --git a/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7Source.hbm.xml b/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7Source.hbm.xml index 01eca66e4e89..c32e5ecbc3d4 100644 --- a/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7Source.hbm.xml +++ b/api/src/main/resources/org/openmrs/hl7/db/hibernate/HL7Source.hbm.xml @@ -28,8 +28,8 @@ - + @@ -37,8 +37,9 @@ - - + + + + diff --git a/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.7.x.xml b/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.7.x.xml index 5911cc7ef823..55a0bff63de8 100644 --- a/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.7.x.xml +++ b/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.7.x.xml @@ -169,5 +169,117 @@ referencedTableName="obs" referencedColumnNames="obs_id"/> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/src/main/resources/org/openmrs/notification/db/hibernate/Alert.hbm.xml b/api/src/main/resources/org/openmrs/notification/db/hibernate/Alert.hbm.xml index e0ec15b9875d..c95f007b0c7c 100644 --- a/api/src/main/resources/org/openmrs/notification/db/hibernate/Alert.hbm.xml +++ b/api/src/main/resources/org/openmrs/notification/db/hibernate/Alert.hbm.xml @@ -48,9 +48,10 @@ - - + + + + diff --git a/api/src/main/resources/org/openmrs/notification/db/hibernate/Template.hbm.xml b/api/src/main/resources/org/openmrs/notification/db/hibernate/Template.hbm.xml index 530d89aefa7c..2f81c9e9470c 100644 --- a/api/src/main/resources/org/openmrs/notification/db/hibernate/Template.hbm.xml +++ b/api/src/main/resources/org/openmrs/notification/db/hibernate/Template.hbm.xml @@ -23,12 +23,13 @@ - + - - + + + diff --git a/api/src/main/resources/org/openmrs/scheduler/db/hibernate/TaskDefinition.hbm.xml b/api/src/main/resources/org/openmrs/scheduler/db/hibernate/TaskDefinition.hbm.xml index 9981bd1dde2e..886f92c4d1d1 100644 --- a/api/src/main/resources/org/openmrs/scheduler/db/hibernate/TaskDefinition.hbm.xml +++ b/api/src/main/resources/org/openmrs/scheduler/db/hibernate/TaskDefinition.hbm.xml @@ -24,9 +24,10 @@ - - + + + + + type="text" + column="schedulable_class" /> - + + + - + diff --git a/api/src/test/java/org/openmrs/util/DatabaseUpdaterDatabaseIT.java b/api/src/test/java/org/openmrs/util/DatabaseUpdaterDatabaseIT.java index fb7616ac9cdc..8c42537592ce 100644 --- a/api/src/test/java/org/openmrs/util/DatabaseUpdaterDatabaseIT.java +++ b/api/src/test/java/org/openmrs/util/DatabaseUpdaterDatabaseIT.java @@ -30,7 +30,7 @@ public class DatabaseUpdaterDatabaseIT extends DatabaseIT { * This constant needs to be updated when adding new Liquibase update files to openmrs-core. */ - private static final int CHANGE_SET_COUNT_FOR_GREATER_THAN_2_1_X = 899; + private static final int CHANGE_SET_COUNT_FOR_GREATER_THAN_2_1_X = 915 ; private static final int CHANGE_SET_COUNT_FOR_2_1_X = 870;