← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18994: Analytics/approval, removed group by clause from insert _dataapprovalminlevel resource table stat...

 

------------------------------------------------------------
revno: 18994
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-04-23 15:43:59 +0200
message:
  Analytics/approval, removed group by clause from insert _dataapprovalminlevel resource table statement, no longer required now that we have a composite unique index on dataapproval
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.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-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java	2015-04-17 08:57:30 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java	2015-04-23 13:43:59 +0000
@@ -595,7 +595,7 @@
         String sql = 
             "insert into " + TABLE_NAME_DATA_APPROVAL_MIN_LEVEL + 
             " (datasetid,periodid,organisationunitid,attributeoptioncomboid,minlevel) " +
-            "select da.datasetid, da.periodid, da.organisationunitid, da.attributeoptioncomboid, min(dal.level) as minlevel " +
+            "select da.datasetid, da.periodid, da.organisationunitid, da.attributeoptioncomboid, dal.level as minlevel " +
             "from dataapproval da " +
             "inner join dataapprovallevel dal on da.dataapprovallevelid=dal.dataapprovallevelid " +
             "where not exists ( " +
@@ -611,8 +611,7 @@
             sql += "da.organisationunitid = ous2.idlevel" + level.getLevel() + " or ";
         }
         
-        sql = TextUtils.removeLastOr( sql ) + ") ) " +
-            "group by da.datasetid, da.periodid, da.organisationunitid, da.attributeoptioncomboid;";
+        sql = TextUtils.removeLastOr( sql ) + ") )";
         
         log.info( "Insert data approval min level SQL: " + sql );