modules/core/dbutils/pom.xml
| 2
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
| 29 +++++++++-
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
| 17 ++++-
3 files changed, 42 insertions(+), 6 deletions(-)
New commits:
commit a751296dc9409ddb9c5e98191c1659f12d763f6d
Author: mtho11 <mikecthompson(a)gmail.com>
Date: Thu Sep 27 13:39:37 2012 -0700
[BZ 861127 - Upgrade issue with respect to min/max property attributes] - Needed to
upgrade existing nulls to 0 for new min/max columns.
(cherry picked from commit 8b08fce535742c6bd7f24d3ab0d8c7d626fe7923)
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index c971f80..e0ceba4 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -17,7 +17,7 @@
<description>Database schema setup, upgrade and other
utilities</description>
<properties>
- <db.schema.version>2.123</db.schema.version>
+ <db.schema.version>2.124</db.schema.version>
<rhq.ds.type-mapping>${rhq.test.ds.type-mapping}</rhq.ds.type-mapping>
<rhq.ds.server-name>${rhq.test.ds.server-name}</rhq.ds.server-name>
<rhq.ds.db-name>${rhq.test.ds.db-name}</rhq.ds.db-name>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 1443b80..ad4b851 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -4013,7 +4013,7 @@
<schema-directSQL>
<statement desc="Updating DOWN Alert Conditions to new
format">
UPDATE RHQ_ALERT_CONDITION
- SET NAME = 'AVAIL_GOES_DOWN', OPTION_STATUS = NULL
+ SET NAME = 'AVAIL_GOES_DOWN', OPTION_STATUS = NULL
WHERE TYPE = 'AVAILABILITY'
AND NAME IS NULL
AND OPTION_STATUS = 'DOWN'
@@ -4033,6 +4033,33 @@
<schemaSpec version="2.123">
<schema-addColumn table="RHQ_CONFIG_PROP_DEF"
column="MIN_ENTRIES" columnType="INTEGER"/>
<schema-addColumn table="RHQ_CONFIG_PROP_DEF"
column="MAX_ENTRIES" columnType="INTEGER"/>
+ <schema-directSQL>
+ <statement desc="Update the NULL to 0 for
MIN_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MIN_ENTRIES = 0
+ WHERE MIN_ENTRIES IS NULL
+ </statement>
+ <statement desc="Update the NULL to 0 for
MAX_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MAX_ENTRIES = 0
+ WHERE MAX_ENTRIES IS NULL
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
+
+ <schemaSpec version="2.124">
+ <schema-directSQL>
+ <statement desc="Update the NULL to 0 for
MIN_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MIN_ENTRIES = 0
+ WHERE MIN_ENTRIES IS NULL
+ </statement>
+ <statement desc="Update the NULL to 0 for
MAX_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MAX_ENTRIES = 0
+ WHERE MAX_ENTRIES IS NULL
+ </statement>
+ </schema-directSQL>
</schemaSpec>
</dbupgrade>
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
index adf1f34..dfca8ee 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
@@ -86,15 +86,24 @@ public class PropertyDefinitionList extends PropertyDefinition {
return max;
}
- public void setMax(int max) {
- this.max = max;
+ public void setMax(Integer max){
+ if(null == max){
+ this.max = 0;
+ }else {
+ this.max = max;
+ }
}
public int getMin() {
return min;
}
- public void setMin(int min) {
- this.min = min;
+ public void setMin(Integer min){
+ if(null == min){
+ this.min = 0;
+ }else {
+ this.min = min;
+ }
}
+
}
Show replies by date