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

Fix Postgres migration when schema is not public. #6340

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

adriennesox
Copy link
Contributor

#6339

If the schema being used for HAPI in Postgres is not the public schema, the 7.4.0 migrations fails because the new DeletePrimaryKeyTask assumes the active schema is public when it looks up the primary key name.

This changes it to use current_schema() if available (i.e. the HAPI user has a search_path set) and 'public' otherwise.

Tested by running the 7.4.2 migrations with this change incorporated against a database where the old migrations were failing.

@adriennesox adriennesox requested a review from a team as a code owner October 2, 2024 18:15
@tadgh
Copy link
Collaborator

tadgh commented Oct 3, 2024

Heya! Sorry it has taken me so long to get to this. Will review it today!

Copy link
Collaborator

@tadgh tadgh left a comment

Choose a reason for hiding this comment

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

Looks good to me! Looks like you're already attributed in the developers section, so I will go ahead and write a changelog for this after it merges 👍🏻

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.53%. Comparing base (406db33) to head (e03af57).
Report is 51 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6340      +/-   ##
============================================
- Coverage     83.54%   83.53%   -0.01%     
- Complexity    27432    27628     +196     
============================================
  Files          1707     1720      +13     
  Lines        106185   106943     +758     
  Branches      13397    13453      +56     
============================================
+ Hits          88710    89339     +629     
- Misses        11750    11827      +77     
- Partials       5725     5777      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tadgh tadgh enabled auto-merge (squash) October 3, 2024 20:26
@tadgh tadgh merged commit 40bdab0 into hapifhir:master Oct 3, 2024
63 of 65 checks passed
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