← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15857: Tracker startup fix

 

------------------------------------------------------------
revno: 15857
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-06-25 23:36:27 +0200
message:
  Tracker startup fix
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.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-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2014-06-25 15:13:15 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2014-06-25 21:36:27 +0000
@@ -276,8 +276,6 @@
         
         executeSql( "UPDATE trackedentityaudit SET accessedmodule='tracked_entity_instance_dashboard' WHERE accessedmodule='instance_dashboard' or accessedmodule='patient_dashboard'" );
         
-        updateUidColumn();
-        
         executeSql( "UPDATE program_attributes SET allowDateInFuture='false' WHERE allowDateInFuture is null" );
 
         executeSql( "UPDATE programstageinstance SET status=1 WHERE completed=true" );
@@ -421,41 +419,6 @@
                 + "  (SELECT trackedentityid FROM trackedentity where name='Person') where trackedentityid is null" );
         }
     }
-
-    private void updateUidColumn()
-    {
-        updateUidColumn( "trackedentityinstancereminder" );
-        updateUidColumn( "programvalidation" );
-    }
-
-    private void updateUidColumn( String tableName )
-    {
-        StatementHolder holder = statementManager.getHolder();
-
-        try
-        {
-            Statement statement = holder.getStatement();
-
-            ResultSet resultSet = statement.executeQuery( "SELECT " + tableName + "id FROM " + tableName
-                + " where uid is null" );
-
-            while ( resultSet.next() )
-            {
-                String uid = CodeGenerator.generateCode();
-
-                executeSql( "UPDATE " + tableName + " SET uid='" + uid + "'  WHERE " + tableName + "id="
-                    + resultSet.getInt( 1 ) );
-            }
-        }
-        catch ( Exception ex )
-        {
-            log.debug( ex );
-        }
-        finally
-        {
-            holder.close();
-        }
-    }
     
     private int executeSql( String sql )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml	2014-06-17 08:15:57 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml	2014-06-25 21:36:27 +0000
@@ -379,6 +379,7 @@
 			<list>
 				<value>trackedentityattribute</value>
 				<value>trackedentityattributegroup</value>
+				<value>trackedentityinstancereminder</value>
 				<value>program</value>
 				<value>programstage</value>
 				<value>programinstance</value>