dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35823
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18340: Integrity check
------------------------------------------------------------
revno: 18340
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-02-19 19:23:12 +0100
message:
Integrity check
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
=== modified file 'resources/sql/integritychecks.sql'
--- resources/sql/integritychecks.sql 2015-01-24 10:59:12 +0000
+++ resources/sql/integritychecks.sql 2015-02-19 18:23:12 +0000
@@ -96,14 +96,12 @@
join periodtype using(periodtypeid)
where de.aggregationtype = 'average';
--- Recreate indexes on aggregated tables
+-- Get category option groups which are members of more than one group set
-drop index aggregateddatavalue_index;
-drop index aggregatedindicatorvalue_index;
-drop index aggregateddatasetcompleteness_index;
-create index aggregateddatavalue_index on aggregateddatavalue (dataelementid, periodid, organisationunitid, categoryoptioncomboid, value);
-create index aggregatedindicatorvalue_index on aggregatedindicatorvalue (indicatorid, periodid, organisationunitid, value);
-create index aggregateddatasetcompleteness_index on aggregateddatasetcompleteness (datasetid, periodid, organisationunitid, value);
+select categoryoptiongroupid, count(categoryoptiongroupid) as count
+from categoryoptiongroupsetmembers
+group by categoryoptiongroupid
+having count(categoryoptiongroupid) > 1;
-- Get missing items in a list / missing options in a category by looking at the sort_order and the max sort_order value