Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a materialised view that has a column for 'type' which is coalesced the same way as in CHT Core #65

Open
latin-panda opened this issue Mar 1, 2021 · 2 comments
Labels
analytics user analytics improvements enhancement

Comments

@latin-panda
Copy link
Contributor

This ticket consists of 2 parts:

Part 1 Create a new materialised view
Currently we have a view for type=person, but there can be multiple "person" types now (eg: "chw", "supervisor", etc) and they are named arbitrarily so we can't create hardcoded views based on the contact_type.

  1. Create a new materialised view that has a column for type which is coalesced the same way we do in CHT Core, eg: SELECT COALESCE (contact_type, type) AS contact_type.

Part 2 Deprecate broken view
This will mean the contactview_person_fields view is broken so we should:

  1. Deprecate it.
  2. Keep it around for backwards compatibility.
  3. Recommend people migrate to the new view.
@mrsarm
Copy link
Contributor

mrsarm commented May 7, 2021

@latin-panda this was already implemented in the PR linked, right? can we close the ticket?

@latin-panda
Copy link
Contributor Author

Hi @mrsarm, This is a bit different from the work in that PR and still to be developed.
The current view (raw_contacts) doesn't consider records with type = "chw", "supervisor", etc.
See this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analytics user analytics improvements enhancement
Projects
None yet
Development

No branches or pull requests

2 participants