dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41965
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21427: Renamed column minmaxdataelement.generated to generatedvalue, another mysql reserverd word
------------------------------------------------------------
revno: 21427
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-12-11 16:59:40 +0100
message:
Renamed column minmaxdataelement.generated to generatedvalue, another mysql reserverd word
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/minmax/hibernate/HibernateMinMaxDataElementStore.java
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/resources/org/hisp/dhis/minmax/hibernate/MinMaxDataElement.hbm.xml
--
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/minmax/hibernate/HibernateMinMaxDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/minmax/hibernate/HibernateMinMaxDataElementStore.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/minmax/hibernate/HibernateMinMaxDataElementStore.java 2015-12-11 15:59:40 +0000
@@ -42,8 +42,6 @@
/**
* @author Kristian Nordal
- * @version $Id: HibernateMinMaxDataElementStore.java 6216 2008-11-06 18:06:42Z
- * eivindwa $
*/
public class HibernateMinMaxDataElementStore
extends HibernateGenericStore<MinMaxDataElement>
=== 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-12-11 10:25:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-12-11 15:59:40 +0000
@@ -275,6 +275,10 @@
executeSql( "ALTER TABLE minmaxdataelement RENAME minvalue TO minimumvalue" );
executeSql( "ALTER TABLE minmaxdataelement RENAME maxvalue TO maximumvalue" );
+
+ executeSql( "update minmaxdataelement set generatedvalue = generated where generatedvalue is null" );
+ executeSql( "alter table minmaxdataelement drop column generated" );
+ executeSql( "alter table minmaxdataelement alter column generatedvalue set not null" );
// orgunit shortname uniqueness
executeSql( "ALTER TABLE organisationunit DROP CONSTRAINT organisationunit_shortname_key" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/minmax/hibernate/MinMaxDataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/minmax/hibernate/MinMaxDataElement.hbm.xml 2013-04-04 14:30:43 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/minmax/hibernate/MinMaxDataElement.hbm.xml 2015-12-11 15:59:40 +0000
@@ -19,7 +19,7 @@
<property name="min" column="minimumvalue" not-null="true" />
<property name="max" column="maximumvalue" not-null="true" />
- <property name="generated" not-null="true" />
+ <property name="generated" column="generatedvalue" />
</class>
</hibernate-mapping>
\ No newline at end of file