data-integrity-orgunitstructure-dirtiness

Registered by jason.p.pickering on 2011-02-25

In delegated systems, where districts are updating their own orgunits, the orgunit structure changes from time to time. It is not so simple to know if the resource tables are out of date.
Implement a data integrity check to provide the organisationunits which are contained in the _orgunitstructure table, but not contained in the corresponding resource tables.

SELECT DISTINCT organisationunitid, name FROM organisationunit
where organisationunitid NOT IN (SELECT DISTINCT organisationunitid from _orgunitstructure)

Similar rules could be implemented for the other resource tables.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
jason.p.pickering
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Another way around this perhaps is to nip it in the bud. Whenever an orgunit is added or its parent is changed, the _orgunitstructure table would be marked as dirty and scheduled for a rebuild with the scheduler.

--

Another way is to simply do it nightly as it takes 5 seconds to generate these things.

--
Also a environmentally unfriendly way to do it, but I would be perfectly happy with it if it was implemented.

--
Admit I didn't consider the environment :)

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.