Mobile app version of vmapp.org
Login or Join
Sue5673885

: How to manage SQL views with dependencies in DHIS 2? We have two SQL views created in DHIS2 v2.24 where one view depends on other one (say, A depends on B). We have also scheduled an automatic

@Sue5673885

Posted in: #Dhis2

We have two SQL views created in DHIS2 v2.24 where one view depends on other one (say, A depends on B). We have also scheduled an automatic maintenance event every day at 12.00 a.m. Problem is DHIS2 tries to drop view B first during this automated procedure and as a result whole procedure fails including analytics table generation.

Is there a way to make DHIS2 scheduled event drop A before B in above case?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sue5673885

1 Comments

Sorted by latest first Latest Oldest Best

 

@Candy875

Currently the approach to achieve this is to rely on the alphabetical ordering of SQL view names. For the scheduled tasks, the system first drops the SQL views in reversed alphabetical order. Finally, the system regenerates the SQL views in alphabetical order.

So in your case where A depends on B, you should ensure that that the name of SQL view B comes before the name of SQL view A alphabetically. This way, the system will first drop A, then B, and when it is time to regenerate the views, first generate B, then A, and you should be good.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme