Skip to content

Commit

Permalink
feat: Migrate tracker change logs into new table [DHIS2-18014]
Browse files Browse the repository at this point in the history
  • Loading branch information
muilpp committed Oct 30, 2024
1 parent 352d583 commit ebc21c3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void deleteEventChangeLog(Event event) {
public void deleteEventChangeLog(DataElement dataElement) {
String sql =
"""
DELETE FROM eventchangelog WHERE dataelementio = :dataelementio
DELETE FROM eventchangelog WHERE dataelementid = :dataelementio
""";
SqlParameterSource params =
new MapSqlParameterSource().addValue("dataelementio", dataElement.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ public TrackerTypeReport persist(EntityManager entityManager, TrackerBundle bund
if (isNew(bundle, trackerDto)) {
entityManager.persist(convertedDto);
entityManager.flush();
// TODO Add this in PR description: Needs to update data values after persisting the
// entity, if not the FK constraint to change logs is not satisfied
updateDataValues(
entityManager, bundle.getPreheat(), trackerDto, convertedDto, bundle.getUser());
typeReport.getStats().incCreated();
Expand All @@ -141,8 +139,6 @@ public TrackerTypeReport persist(EntityManager entityManager, TrackerBundle bund
typeReport.getStats().incIgnored();
// Relationships are not updated. A warning was already added to the report
} else {
// TODO Add this in PR description: Needs to update data values first, if not deleted
// values will not be updated in the event object
updateDataValues(
entityManager, bundle.getPreheat(), trackerDto, convertedDto, bundle.getUser());
updateAttributes(
Expand Down

0 comments on commit ebc21c3

Please sign in to comment.