← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21420: Renamed column keyjsonvalue.key to namespacekey. Reserved word in mysql.

 

------------------------------------------------------------
revno: 21420
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-12-11 11:25:42 +0100
message:
  Renamed column keyjsonvalue.key to namespacekey. Reserved word in mysql.
modified:
  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/keyjsonvalue/hibernate/KeyJsonValue.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/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-12-08 10:38:38 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-12-11 10:25:42 +0000
@@ -863,6 +863,10 @@
         executeSql( "update programstage set reportdatetouse = 'indicentDate' where reportdatetouse='dateOfIncident'" );
 
         executeSql( "alter table programindicator drop column missingvaluereplacement" );
+        
+        executeSql( "update keyjsonvalue set namespacekey = key where namespacekey is null" );
+        executeSql( "alter table keyjsonvalue alter column namespacekey set not null" );
+        executeSql( "alter table keyjsonvalue drop column key" );
 
         // Remove data mart
         executeSql( "drop table aggregateddatasetcompleteness" );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/keyjsonvalue/hibernate/KeyJsonValue.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/keyjsonvalue/hibernate/KeyJsonValue.hbm.xml	2015-11-02 04:09:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/keyjsonvalue/hibernate/KeyJsonValue.hbm.xml	2015-12-11 10:25:42 +0000
@@ -16,7 +16,7 @@
 
         <property name="namespace" column="namespace" type="string" length="255" not-null="true" unique-key="keyjsonvalue_unique_key_in_namespace"/>
 
-        <property name="key" column="key" type="string" length="255" not-null="true" unique-key="keyjsonvalue_unique_key_in_namespace" />
+        <property name="key" column="namespacekey" type="string" length="255" unique-key="keyjsonvalue_unique_key_in_namespace" /> <!-- set not-null -->
 
         <property name="value" column="value" type="text"/>