Skip to content

Commit

Permalink
fix: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge committed Dec 16, 2024
1 parent 1867eb5 commit dc2f539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ private String getInputSql(Program program) {
\sfrom (\
select h.trackedentityid, '${historyTableId}' as startdate, h.enddate as enddate, h.organisationunitid \
from ${programownershiphistory} h \
where h.programid=${programId} \
where h.programid = ${programId} \
and h.organisationunitid is not null \
union \
select o.trackedentityid, '${trackedEntityOwnTableId}' as startdate, null as enddate, o.organisationunitid \
from ${trackedentityprogramowner} o \
where o.programid=${programId} \
where o.programid = ${programId} \
and exists (\
select 1 from ${programownershiphistory} p \
where o.trackedentityid = p.trackedentityid \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,16 @@ void testPopulateTable() throws SQLException {
select te.uid,a.startdate,a.enddate,ou.uid from (\
select h.trackedentityid, '1001-01-01' as startdate, h.enddate as enddate, h.organisationunitid \
from "programownershiphistory" h \
where h.programid=0 and h.organisationunitid is not null \
where h.programid = 0 \
and h.organisationunitid is not null \
union \
select o.trackedentityid, '2002-02-02' as startdate, null as enddate, o.organisationunitid \
from "trackedentityprogramowner" o \
where o.programid=0 \
where o.programid = 0 \
and exists (select 1 from "programownershiphistory" p \
where o.trackedentityid = p.trackedentityid \
and p.programid=0 and p.organisationunitid is not null)\
and p.programid = 0 \
and p.organisationunitid is not null)\
) a \
inner join "trackedentity" te on a.trackedentityid = te.trackedentityid \
inner join "organisationunit" ou on a.organisationunitid = ou.organisationunitid \
Expand Down

0 comments on commit dc2f539

Please sign in to comment.