dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37226
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19050: some model-cleanup: added not-null for programrule.condition and removed column programruleaction...
------------------------------------------------------------
revno: 19050
committer: Markus Bekken <markus.bekken@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-04-28 22:52:00 +0200
message:
some model-cleanup: added not-null for programrule.condition and removed column programruleaction.name
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRule.hbm.xml
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRuleAction.hbm.xml
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-04-26 19:37:25 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-04-28 20:52:00 +0000
@@ -268,6 +268,10 @@
executeSql( "ALTER TABLE program ALTER description TYPE text" );
executeSql( "ALTER TABLE trackedentityattribute ALTER description TYPE text" );
executeSql( "ALTER TABLE trackedentityattributegroup ALTER description TYPE text" );
+ executeSql( "ALTER TABLE programrule ALTER condition TYPE text" );
+ executeSql( "ALTER TABLE programruleaction ALTER content TYPE text" );
+ executeSql( "ALTER TABLE programruleaction ALTER data TYPE text" );
+
executeSql( "ALTER TABLE minmaxdataelement RENAME minvalue TO minimumvalue" );
executeSql( "ALTER TABLE minmaxdataelement RENAME maxvalue TO maximumvalue" );
@@ -413,7 +417,6 @@
executeSql( "ALTER TABLE validationrulegroup DROP COLUMN uuid" );
// replace null with false for boolean fields
-
executeSql( "update dataset set fieldcombinationrequired = false where fieldcombinationrequired is null" );
executeSql( "update chart set hidelegend = false where hidelegend is null" );
executeSql( "update chart set regression = false where regression is null" );
@@ -742,7 +745,7 @@
executeSql( "ALTER TABLE dataelementgroupset ALTER COLUMN datadimension SET NOT NULL" );
executeSql( "UPDATE orgunitgroupset SET datadimension=true WHERE datadimension IS NULL" );
executeSql( "ALTER TABLE orgunitgroupset ALTER COLUMN datadimension SET NOT NULL" );
-
+
// set attribute defaults
executeSql( "UPDATE attribute SET dataelementattribute=false WHERE dataelementattribute IS NULL" );
executeSql( "UPDATE attribute SET dataelementgroupattribute=false WHERE dataelementgroupattribute IS NULL" );
@@ -765,6 +768,9 @@
// update attribute.code, set to null if code=''
executeSql( "UPDATE attribute SET code=NULL WHERE code=''" );
+ //update programruleaction:
+ executeSql( "ALTER TABLE programruleaction DROP COLUMN name" );
+
// data approval
executeSql( "UPDATE dataapproval SET accepted=false WHERE accepted IS NULL" );
executeSql( "ALTER TABLE dataapproval ALTER COLUMN accepted SET NOT NULL" );
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRule.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRule.hbm.xml 2015-04-28 16:43:41 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRule.hbm.xml 2015-04-28 20:52:00 +0000
@@ -31,7 +31,7 @@
<one-to-many class="org.hisp.dhis.programrule.ProgramRuleAction" />
</set>
- <property name="condition" />
+ <property name="condition" type="text" not-null="true" />
<property name="priority" />
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRuleAction.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRuleAction.hbm.xml 2015-04-28 16:43:41 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/programrule/hibernate/ProgramRuleAction.hbm.xml 2015-04-28 20:52:00 +0000
@@ -16,8 +16,6 @@
&identifiableProperties;
- <property name="name" column="name" not-null="true" length="230" />
-
<many-to-one name="programRule" class="org.hisp.dhis.programrule.ProgramRule"
column="programruleid" foreign-key="fk_programruleaction_programrule" />
@@ -33,8 +31,8 @@
<property name="location" />
- <property name="content" />
+ <property name="content" type="text" />
- <property name="data" />
+ <property name="data" type="text" />
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2015-04-28 16:43:41 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2015-04-28 20:52:00 +0000
@@ -1180,6 +1180,7 @@
ProgramRule programRule = new ProgramRule();
programRule.setName( "ProgramRule" + uniqueCharacter );
programRule.setProgram( parentProgram );
+ programRule.setCondition("true");
return programRule;
}