← Back to team overview

dhis2-users team mailing list archive

Re: Script to disassociate Orgunit with Datavalue

 

Hi there!

You can have a look here
https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/delete_orgunit_with_data.sql

which will delete the site and all object associated with it. You should
supply the UID of the orgunit you wish to delete as a paramater to the
Postgresql function.

You may also need to update the script to suit the version of DHIS2 you are
running.

As usual, be sure to test this on a development database first!

Best regards,
Jason


On Thu, Oct 11, 2018 at 10:49 AM Walusiku Muyunda <jomuwalu@xxxxxxxxx>
wrote:

> Dear All,
>
> Is there there anyone with a script to disassociate an Orgunit from all
> associated programs or data sets so I can be able to delete it from within
> DHIS2?
>
> Thank you.
>
>
>
> *Walusiku J. Muyunda*
>
>
> *Cell: +260967006614Cell: +260971000614*
> *Cell: +260953063387*
>
> *"We have heaven to win and hell to shun, our lives testify better!"
> <http://wildvoices.blogspot.com/>*
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>


-- 
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049

Follow ups

References