medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
466 stars 217 forks source link

Deleting places does not always remove references to that place #969

Open alxndrsn opened 9 years ago

alxndrsn commented 9 years ago

Observed behaviour

Contact

When a contact is deleted, it remains associated with:

When a catchment area is deleted, it remains associated with:

When a health centre is deleted, it remains associated with:

When a district is deleted, it remains associated with:

Associated objects should probably be updated when a contact is deleted.

alxndrsn commented 9 years ago

Simplest place to enforce this is surely validate_doc_update in the design doc.

alxndrsn commented 9 years ago

Or perhaps not: https://stackoverflow.com/questions/6069324/can-i-query-views-from-a-couchdb-update-or-validate-doc-update-function