Skip to content

Commit

Permalink
fix: revert table renames
Browse files Browse the repository at this point in the history
  • Loading branch information
jbee committed Nov 30, 2023
1 parent 00cf054 commit 16ed1a4
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 23 deletions.
4 changes: 0 additions & 4 deletions dhis-2/dhis-services/dhis-service-administration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ section: Categories
summary_sql: >-
select
COUNT(*) as value,
100 * COUNT(*) / NULLIF( (SELECT COUNT(*) FROM category), 0) as percent
from category where categoryid
100 * COUNT(*) / NULLIF( (SELECT COUNT(*) FROM dataelementcategory), 0) as percent
from dataelementcategory where categoryid
not in (select distinct categoryid from categories_categoryoptions);
details_sql: >-
SELECT uid,name from category
SELECT uid,name from dataelementcategory
where categoryid
not in (select distinct categoryid from categories_categoryoptions)
ORDER BY name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ name: categories_one_default_category
description: Only one "default" category should exist
section: Categories
summary_sql: >-
SELECT count(*) AS count FROM category
SELECT count(*) AS count FROM dataelementcategory
WHERE name = 'default' AND uid != 'GLevLNI9wkl';
details_sql: >-
SELECT uid, name FROM category
SELECT uid, name FROM dataelementcategory
WHERE name = 'default' AND uid != 'GLevLNI9wkl'
ORDER BY categoryid;
details_id_type: categories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ name: categories_one_default_category_option
description: Only one "default" category option should exist
section: Categories
summary_sql: >-
SELECT count(*) AS count FROM categoryoption
SELECT count(*) AS count FROM dataelementcategoryoption
WHERE name = 'default' AND uid != 'xYerKDKCefk';
details_sql: >-
SELECT uid, name FROM categoryoption
SELECT uid, name FROM dataelementcategoryoption
WHERE name = 'default' AND uid != 'xYerKDKCefk'
ORDER BY categoryoptionid;
details_id_type: categoryOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
)
SELECT COUNT(*) as value,
100.0 * COUNT(*) / NULLIF( (SELECT COUNT(*)
FROM category),0 ) percent
FROM dataelementcategory),0 ) percent
FROM duplicative_categories;
details_sql: >-
SELECT x.uid,'(' || b.rank || ') ' || x.name as name from category x
SELECT x.uid,'(' || b.rank || ') ' || x.name as name from dataelementcategory x
INNER JOIN (
SELECT categoryid, array_agg(categoryoptionid ORDER BY categoryoptionid) as catoptions
from categories_categoryoptions GROUP BY categoryid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ summary_sql: >-
select cc.name as cc_name, co.categoryoptionid, co.name as co_name from categorycombo cc
inner join categorycombos_categories ccc on cc.categorycomboid=ccc.categorycomboid
inner join categories_categoryoptions cco on ccc.categoryid=cco.categoryid
inner join categoryoption co on cco.categoryoptionid=co.categoryoptionid
inner join dataelementcategoryoption co on cco.categoryoptionid=co.categoryoptionid
group by cc_name, co.categoryoptionid, co_name having count(*) > 1 )
SELECT
COUNT(*)as value,
Expand All @@ -45,7 +45,7 @@ details_sql: >-
select cc.uid, cc.name as cc_name, co.categoryoptionid, co.name as co_name from categorycombo cc
inner join categorycombos_categories ccc on cc.categorycomboid=ccc.categorycomboid
inner join categories_categoryoptions cco on ccc.categoryid=cco.categoryid
inner join categoryoption co on cco.categoryoptionid=co.categoryoptionid
inner join dataelementcategoryoption co on cco.categoryoptionid=co.categoryoptionid
group by cc.uid, cc_name, co.categoryoptionid, co_name having count(*) > 1 )
SELECT uid,
cc_name as name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ summary_sql: >-
INNER JOIN categoryoptiongroupsetmembers b on a.categoryoptiongroupid = b.categoryoptiongroupid ) c
GROUP BY c.categoryoptionid,c.categoryoptiongroupsetid
HAVING array_length(array_agg(c.categoryoptionid), 1) > 1 ) d ) e
INNER JOIN categoryoption co on e.categoryoptionid = co.categoryoptionid
INNER JOIN dataelementcategoryoption co on e.categoryoptionid = co.categoryoptionid
INNER JOIN categoryoptiongroupset cogs on e.categoryoptiongroupsetid = cogs.categoryoptiongroupsetid
INNER JOIN categoryoptiongroup cog on e.categoryoptiongroupid = cog.categoryoptiongroupid ) x
GROUP BY x.uid,x.name,x.cogs_name
Expand All @@ -74,7 +74,7 @@ details_sql: >-
INNER JOIN categoryoptiongroupsetmembers b on a.categoryoptiongroupid = b.categoryoptiongroupid ) c
GROUP BY c.categoryoptionid,c.categoryoptiongroupsetid
HAVING array_length(array_agg(c.categoryoptionid), 1) > 1 ) d ) e
INNER JOIN categoryoption co on e.categoryoptionid = co.categoryoptionid
INNER JOIN dataelementcategoryoption co on e.categoryoptionid = co.categoryoptionid
INNER JOIN categoryoptiongroupset cogs on e.categoryoptiongroupsetid = cogs.categoryoptiongroupsetid
INNER JOIN categoryoptiongroup cog on e.categoryoptiongroupid = cog.categoryoptiongroupid ) x
GROUP BY x.uid,x.name,x.cogs_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ summary_sql: >-
(SELECT categoryid,array_agg(categoryoptionid) as wants from categories_categoryoptions
GROUP BY categoryid) as z USING (categoryid) ) as cat_option_group_check ) f) g
INNER JOIN categoryoptiongroupset cogs USING(categoryoptiongroupsetid)
INNER JOIN category cats USING(categoryid)
INNER JOIN categoryoption opt USING(categoryoptionid)
INNER JOIN dataelementcategory cats USING(categoryid)
INNER JOIN dataelementcategoryoption opt USING(categoryoptionid)
ORDER BY cogs.uid, cats.name)
SELECT COUNT(*) as value,
100 * COUNT(*) / NULLIF( (SELECT COUNT(*) from categoryoptiongroupmembers
Expand Down Expand Up @@ -83,8 +83,8 @@ details_sql: >-
(SELECT categoryid,array_agg(categoryoptionid) as wants from categories_categoryoptions
GROUP BY categoryid) as z USING (categoryid) ) as cat_option_group_check ) f) g
INNER JOIN categoryoptiongroupset cogs USING(categoryoptiongroupsetid)
INNER JOIN category cats USING(categoryid)
INNER JOIN categoryoption opt USING(categoryoptionid)
INNER JOIN dataelementcategory cats USING(categoryid)
INNER JOIN dataelementcategoryoption opt USING(categoryoptionid)
ORDER BY cogs.uid, cats.name;
details_id_type: categoryOptionGroupSets
severity: SEVERE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
section_order: 3
summary_sql: >-
WITH category_options_no_categories AS (
SELECT uid,name FROM categoryoption
SELECT uid,name FROM dataelementcategoryoption
WHERE categoryoptionid
NOT IN
(SELECT DISTINCT categoryoptionid
Expand All @@ -41,7 +41,7 @@
FROM categoryoption), 0 ) as percent
FROM category_options_no_categories;
details_sql: >-
SELECT uid,name FROM categoryoption
SELECT uid,name FROM dataelementcategoryoption
WHERE categoryoptionid
NOT IN
(SELECT DISTINCT categoryoptionid
Expand Down

0 comments on commit 16ed1a4

Please sign in to comment.