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

RN-558: Specify DHIS Server Explicit #4084

Merged
merged 4 commits into from
Aug 15, 2022

Conversation

chris-pollard
Copy link
Contributor

Issue RN-558:

Changes:

  • Add migration to update null values to country server for dhisInstanceCode in data_element and data_group tables.

Copy link
Contributor

@IgorNadj IgorNadj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change for sql but otherwise looks good, thanks!

await db.runSql(`
UPDATE "data_group"
SET "config" = jsonb_set("config", '${DHIS_INSTANCE_CODE_JSONPATH}', '"${server}"')
WHERE config::text like '%"dhisInstanceCode": null%' AND substring(code from 1 for 2) = '${prefix}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHERE (config->'dhisInstanceCode') is not null and (config->>'dhisInstanceCode') is null

First part makes sure the key exists, second part makes sure the json value is null

@chris-pollard chris-pollard merged commit 3453032 into dev Aug 15, 2022
@chris-pollard chris-pollard deleted the rn-558-specify-dhis-server-explicit branch August 15, 2022 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants