← Back to team overview

dhis2-users team mailing list archive

Re: Deleting old data elements

 

Busoye is right.  You need to make sure that the data elements are deleted from all the tables where they may appear (below is a list of most of them):

Dataelementaggregationlevels
Dataelementaggributevalues
dataelementgroupmembers
dataelementoperand
datasetmembers
datavalue
datavalue_audit
datavaluearchive

** if you use the patient tracker module
patientaggregatereport
patientdatavalue
patientdatavaluearchive
programstage_dataelements

reporttable_dataelements
sectiondataelements
sectiongreyedfields
	
** if you use the SMS module
smscodes

** if you did translations of your data elements
translation

You might want to create a script that deletes the specific dataelementids in each table before deleting from the dataelement table.

Randy

-----Original Message-----
From: Dhis2-users [mailto:dhis2-users-bounces+rwilson=msh.org@xxxxxxxxxxxxxxxxxxx] On Behalf Of Adebusoye Anifalaje
Sent: Wednesday, August 28, 2013 9:10 AM
To: Jose Garcia Muñoz
Cc: dhis2-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Dhis2-users] Deleting old data elements

Hi Jose,

If you try deleting those elements from PGAdmin, the error message will include the object/table to which the data element is associated. You should then delete that association  and try deleting the data element again. You could also follow what is happening in your tomcat window when you press delete. This will also let you know the data element cannot be deleted because it is referenced in another table like an org unit group.

Hope this helps.

Regards

Busoye   

On 28 Aug 2013, at 00:41, Jose Garcia Muñoz <josemp10@xxxxxxxxx> wrote:

> 
> Dear all,
> 
> I am trying to delete some old dataelements. Previously I have deleted, using SQL delete sentences, all datavalues associated to them. Everything goes well, but still some data elements don't want to disappear. I mean, when I click on the Remove button (web interface):
> 
> 1) Some times appear the message "Deleting ....", but nothing really happens.
> 
> or
> 
> 2) Other times appear the following message: "Object not deleted because it is associated by object of type"
> 
> Any ideas about 1) or 2)? I am using DHIS 2.12 and postgresql
> 
> Thanks!
> Jose
> _______________________________________________
> 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


_______________________________________________
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


Follow ups

References