← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3074: Added script

 

------------------------------------------------------------
revno: 3074
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-03-18 13:55:58 +0100
message:
  Added script
added:
  resources/sql/grouping.sql
renamed:
  resources/sql/movedata.sql => resources/sql/copydata.sql
modified:
  resources/sql/integritychecks.sql


--
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
=== renamed file 'resources/sql/movedata.sql' => 'resources/sql/copydata.sql'
=== added file 'resources/sql/grouping.sql'
--- resources/sql/grouping.sql	1970-01-01 00:00:00 +0000
+++ resources/sql/grouping.sql	2011-03-18 12:55:58 +0000
@@ -0,0 +1,10 @@
+
+-- Groups orgunits into groups based on the text match in the where clause for the orgunit group with the given id
+
+insert into orgunitgroupmembers(orgunitgroupid,organisationunitid)
+select 22755 as orgunitgroupid,ou.organisationunitid as organisationunitid from organisationunit ou 
+where (name like '%Dispensary%' or name like '%dispensary%')
+and not exists (
+select orgunitgroupid from orgunitgroupmembers om 
+where ou.organisationunitid=om.organisationunitid
+and om.orgunitgroupid=22755);

=== modified file 'resources/sql/integritychecks.sql'
--- resources/sql/integritychecks.sql	2011-03-18 11:22:44 +0000
+++ resources/sql/integritychecks.sql	2011-03-18 12:55:58 +0000
@@ -35,7 +35,8 @@
 where sd.dataelementid not in (
   select dm.dataelementid from datasetmembers dm
   join dataset ds on(dm.datasetid=ds.datasetid)
-  where sc.datasetid=ds.datasetid);
+  where sc.datasetid=ds.datasetid)
+order by ds.name, de.name;
 
 -- Get orgunit groups which an orgunit is member of