Skip to content

[backend] fix(multi-tenancy): migration 5_06 without alter database (#4864)#5690

Merged
corinnekrych merged 5 commits intorelease/currentfrom
issue/remove-alter-database
May 5, 2026
Merged

[backend] fix(multi-tenancy): migration 5_06 without alter database (#4864)#5690
corinnekrych merged 5 commits intorelease/currentfrom
issue/remove-alter-database

Conversation

@corinnekrych
Copy link
Copy Markdown
Contributor

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

  1. Step-by-step how to test
  2. Environment or config notes

Related issues

  • Closes #ISSUE-NUMBER

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

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...

@corinnekrych corinnekrych requested review from Copilot and esrevi May 5, 2026 09:57
@github-actions github-actions Bot added the filigran team use to identify PR from the Filigran team label May 5, 2026
@corinnekrych corinnekrych changed the title [backend] fix(multi-tenancy): 5_06 migration without alter database [backend] fix(multi-tenancy): 5_06 migration without alter database (#4864) May 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 = ... with ALTER ROLE ... SET app.current_tenant = ... in the V5_06 migration.
  • Removes database name lookup (getCatalog()) since the migration no longer issues ALTER DATABASE.

@corinnekrych corinnekrych requested review from savacano28 and removed request for esrevi May 5, 2026 10:02
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.40%. Comparing base (d3c8444) to head (2d75908).

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              
Flag Coverage Δ
backend 64.34% <100.00%> (-0.01%) ⬇️
frontend 1.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@corinnekrych corinnekrych changed the title [backend] fix(multi-tenancy): 5_06 migration without alter database (#4864) [backend] fix(multi-tenancy): migration 5_06 without alter database (#4864) May 5, 2026
@corinnekrych corinnekrych merged commit 598a468 into release/current May 5, 2026
36 checks passed
@corinnekrych corinnekrych deleted the issue/remove-alter-database branch May 5, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants