dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #49395
Deletion of Data Set and all associated objects via API v 2.25
Hi,
Further to my other email thread regarding Program deletion, we have been
working on functionality to delete full Data Sets and all associated data
and metadata via the Web API using:
Version:
2.25
Build revision:
ee7e61b
Build date:
2017-05-19 12:47
The instance being used is assuming that data elements are specific to a
particular data set and will not be reused across data sets.
This is our methodology in order of execution, all via the Web API:
1. Delete Data Set Data
1. iterate through all associated data elements and use the
/maintenance/dataPruning/dataElements functionality
2. Delete Data Set Metadata
1. delete all related indictors for data set data elements
2. delete related data elements
3. delete related category option combos / category combos
3. Delete Data Set
1. delete data set
I see some things in the data set payload such as:
- "translations": [],
- "userGroupAccesses": [],
- "attributeValues": [],
- "sections": [],
- "compulsoryDataElementOperands": [],
Do any of these need to be explicitly deleted in order to delete a data set
or will they cascade? Are there any other associated objects I haven't
mentioned that we need to delete? So far we've been implementing on a trial
and error basis.
Please let me know if there are any other considerations we should be
incorporating into our logic.
Thanks,
Lorill
--
Lorill Crees
Project Leader / Senior Developer
2Paths Solutions Ltd. <http://www.2paths.com>
lcrees@xxxxxxxxxx
skype: lorill2paths
(604) 689-4123 x 15