From b337034f426b43d54dfec2732e7eff0165876e88 Mon Sep 17 00:00:00 2001 From: icrc-loliveira Date: Wed, 14 Aug 2024 11:34:55 +0100 Subject: [PATCH 1/2] Change formResource to extend from BaseChangeableOpenmrsMetadata. --- .../main/java/org/openmrs/FormResource.java | 37 +------ .../liquibase-update-to-latest-2.5.x.xml | 98 +++++++++++++++++++ 2 files changed, 99 insertions(+), 36 deletions(-) diff --git a/api/src/main/java/org/openmrs/FormResource.java b/api/src/main/java/org/openmrs/FormResource.java index 2f701a49bd6a..401ab8cdd022 100644 --- a/api/src/main/java/org/openmrs/FormResource.java +++ b/api/src/main/java/org/openmrs/FormResource.java @@ -9,10 +9,7 @@ */ package org.openmrs; -import java.util.Date; - import org.codehaus.jackson.annotate.JsonIgnore; -import org.hibernate.envers.Audited; import org.openmrs.customdatatype.CustomDatatypeUtil; import org.openmrs.customdatatype.CustomValueDescriptor; import org.openmrs.customdatatype.NotYetPersistedException; @@ -30,8 +27,7 @@ * * @since 1.9 */ -@Audited -public class FormResource extends BaseOpenmrsObject implements CustomValueDescriptor, SingleCustomValue { +public class FormResource extends BaseChangeableOpenmrsMetadata implements CustomValueDescriptor, SingleCustomValue { private static final long serialVersionUID = 1L; @@ -55,10 +51,6 @@ public class FormResource extends BaseOpenmrsObject implements CustomValueDescri private transient Object typedValue; - private User changedBy; - - private Date dateChanged; - public FormResource() { // generic constructor } @@ -272,31 +264,4 @@ public boolean getDirty() { return dirty; } - /** - * @return Returns the changedBy. - */ - public User getChangedBy() { - return changedBy; - } - - /** - * @param changedBy The user that changed this object - */ - public void setChangedBy(User changedBy) { - this.changedBy = changedBy; - } - - /** - * @return Returns the date this object was changed - */ - public Date getDateChanged() { - return dateChanged; - } - - /** - * @param dateChanged The date this object was changed - */ - public void setDateChanged(Date dateChanged) { - this.dateChanged = dateChanged; - } } diff --git a/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.5.x.xml b/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.5.x.xml index 1cc135ca361e..2da22dd543a9 100644 --- a/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.5.x.xml +++ b/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.5.x.xml @@ -390,4 +390,102 @@ tableName="encounter_diagnosis" /> + + + + + + + Adding "description" column to form_resource table + + + + + + + + + + + + + + Adding "creator" column to form_resource table + + + + + + + + + + + + + + Adding "date created" column to form_resource table + + + + + + + + + + + + + + Adding "retired" column to form_resource table + + + + + + + + + + + + + + Adding "date created" column to form_resource table + + + + + + + + + + + + + + Adding "retired by" column to form_resource table + + + + + + + + + + + + + + Adding "retired reason" column to form_resource table + + + + + + + From 2c7185fe33f482aa10a8bc90cc59f6c291ca61d3 Mon Sep 17 00:00:00 2001 From: icrc-loliveira Date: Wed, 14 Aug 2024 12:06:52 +0100 Subject: [PATCH 2/2] Fixed test --- .../test/java/org/openmrs/util/DatabaseUpdaterDatabaseIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/test/java/org/openmrs/util/DatabaseUpdaterDatabaseIT.java b/api/src/test/java/org/openmrs/util/DatabaseUpdaterDatabaseIT.java index f22b4aee80ef..c735c1a8b574 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 H2DatabaseIT { * 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 = 897; + private static final int CHANGE_SET_COUNT_FOR_GREATER_THAN_2_1_X = 904; private static final int CHANGE_SET_COUNT_FOR_2_1_X = 870;