← Back to team overview

dhis2-users team mailing list archive

Re: [Dhis2-devs] In DHIS 2.27 Issues with deleting organisation unit

 

Hi Jhansi,
You will also need to get rid of the data in the data value audit table.

Here is an SQL function which might work for you.

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

Regards,
Jason


On Thu, Dec 14, 2017 at 2:49 PM, Jhansi Reddy Karee <
jhansirk@xxxxxxxxxxxxxxxx> wrote:

> Hello Team,
>
>
> In DHIS 2.27, we are not able to delete an organisation unit after
> deleting all the data associated to it.
>
>
> Following are the steps we have followed to do this:
>
>    -
>
>    Delete all the data associated to the organisation unit
>    -
>
>    In Data administration app, under maintenance, we have performed
>    maintenance over “Permanently remove soft deleted data values”.
>    -
>
>    Tried deleting the organisation unit. But, we are getting the
>    following error: Could not delete due to association with another object:
>    DataValueAudit
>
>
> Please let us know if we have missed anything.
>
>
> Thanks,
>
> Jhansi
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


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

Follow ups

References