Hi there,

Here is a sql function for deleting the whole or parts of your orgunit tree:

https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/delete_orgunittree_with_data.sql

If you create this function, you can invoke it with 
select delete_orgunittree_with_data('<UID of the root orgunit>');

Best regards,
Markus

> 11. jul. 2017 kl. 15.41 skrev Jesus Solano-Roman <asol...@broadinstitute.org>:
> 
> Hello all.
> 
> I'm trying to bulk remove all existing Orgunits from my database and I found 
> this CLI API https://github.com/baosystems/dish2 
> <https://github.com/baosystems/dish2> that allows to exactly do that. 
> However, it hasn't worked for me, perhaps due to my current system 
> infrastructure. Is there another way to bulk remove metadata from the DHIS2 
> database?
> 
> I should note that I'm trying to accomplish this using the Docker version of 
> the DHIS2 distribution (I realize it's not official, but it's extremely 
> convenient). https://github.com/pgracio/dhis2-docker 
> <https://github.com/pgracio/dhis2-docker>
> 
> 
> Thank you.
> 
> 
> Antonio.
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to