[backend] fix(multi-tenancy): migration 5_06 without alter database (#4864)#5690
Merged
corinnekrych merged 5 commits intorelease/currentfrom May 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Flyway migration V5_06__Enable_row_level_security to avoid requiring ALTER DATABASE privileges during pre-release deployments by switching the default app.current_tenant initialization from a database-level setting to a role-level setting.
Changes:
- Replaces
ALTER DATABASE ... SET app.current_tenant = ...withALTER ROLE ... SET app.current_tenant = ...in the V5_06 migration. - Removes database name lookup (
getCatalog()) since the migration no longer issuesALTER DATABASE.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/current #5690 +/- ##
=====================================================
- Coverage 40.40% 40.40% -0.01%
Complexity 6112 6112
=====================================================
Files 2123 2123
Lines 56998 56997 -1
Branches 7230 7230
=====================================================
- Hits 23031 23030 -1
Misses 32611 32611
Partials 1356 1356
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…-Platform/openaev into issue/remove-alter-database
savacano28
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Pre-release is failing to run v5_06 migration due to privilege for "ALTER DATABASE".
This PR propose an alternative which required less privileges.
Testing Instructions
Related issues
Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...