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

Update contactview_metadata to be compatible with configurable contact hierarchies #61

Closed
1yuv opened this issue Nov 13, 2020 · 8 comments
Assignees
Labels

Comments

@1yuv
Copy link
Member

1yuv commented Nov 13, 2020

Current version of contactview_metadata was last updated on 2018. Since then, we've added configurable hierarchy to CHT-Core and for most of the partners using latest version of CHT-Core, contact_type field is also important.

Whenever couch2pg runs, it creates contactview_metadata, so we should ensure that we're creating required field in contactview_metadata instead of partners/tech leads requiring to drop and recreate this mat view again.

@latin-panda latin-panda self-assigned this Feb 24, 2021
@1yuv
Copy link
Member Author

1yuv commented Feb 25, 2021

Hi @latin-panda ,
Current version of script doesn't reassign owner to full_access, hence that work needs to be taken care manually most of the time.

Can you reassign the owner for each object after they're created to full_access as well?
The syntax is :

ALTER [OBJECT_TYPE] [OBJECT_NAME] OWNER TO full_access;

@nomulex
Copy link
Contributor

nomulex commented Feb 26, 2021

full_access is a medic specific role, I am not sure if this is wise to put it in the code that will be used by the cht community.

@1yuv
Copy link
Member Author

1yuv commented Feb 26, 2021

I also thought about that. But, this repo (medic-couch2pg) is medic specific instance and I think we should put that. But not put REASSIGN on our public repo.

@latin-panda
Copy link
Contributor

Hey guys, I've verified and effectively this repo is designed to support all CHT deployments, even self hosted. So we should not hardcode Medic-specific roles, but we can include this as a separate script that runs in demand, I've raised a ticket to address this next.

@newtewt newtewt self-assigned this Mar 4, 2021
@newtewt
Copy link

newtewt commented Mar 8, 2021

I've tested this in my local setup. By tearing down the current medic-couch2pg container and then spinning up one from this branch. The materialized view sql statement is updated in the properties and the query returns the screenshot below. I am not sure how our Prod upgrade process works for medic-couch2pg and if it's worth verifying during this to ensure it doesn't break.

@newtewt
Copy link

newtewt commented Mar 8, 2021

Screenshot from 2021-03-08 11-29-27

@newtewt
Copy link

newtewt commented Mar 9, 2021

@latin-panda this is ready to merge.

latin-panda added a commit that referenced this issue Mar 16, 2021
Ticket: #61

In this commit:
* Add contact_type column to contactview_metadata materialized view.
* Add a unit test to check that materialized views have the required columns defined.
@latin-panda
Copy link
Contributor

PR has been merged.

latin-panda added a commit that referenced this issue Mar 19, 2021
Ticket: #61

In this commit:
* Add contact_type column to contactview_metadata materialized view.
* Add a unit test to check that materialized views have the required columns defined.
@garethbowen garethbowen changed the title Update contactview_metadata to adhere to Updated CHT-Core Update contactview_metadata to be compatible with configurable contact hierarchies Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants