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?
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!
EXECUTE ‘SELECT organisationunitid from organisationunit where uid = ‘tPR9B5xETb’’‘’ || $1 || ‘’‘’ INTO organisationunitid; Is this where I need to specify the uid?