fix(dashboard): preserve rls policies on tenant migrations fix plan#1898
Merged
Conversation
Add a filter in pgdelta to preserve RLS policies in the realtime schema. This is important to let Tenant Migrations fix schemas without dropping existing RLS. For eg a schema with missing `messages_inserted_at_topic_index` and existing RLS policies in `realtime.messages` without pgdelta filter does create a plan like: ```sql -- Risk: safe DROP POLICY "authenticated broadcast on topic" ON realtime.messages; DROP POLICY "authenticated receive on topic" ON realtime.messages; CREATE INDEX messages_inserted_at_topic_index ON realtime.messages (inserted_at DESC, topic) WHERE extension = 'broadcast'::text AND private IS TRUE; ```
edgurgel
approved these changes
May 20, 2026
|
🎉 This PR is included in version 2.97.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Add a filter in pgdelta to preserve RLS policies in the realtime schema.
This is important to let Tenant Migrations fix schemas without dropping existing RLS.
For eg a schema with missing
messages_inserted_at_topic_indexand existing RLS policies inrealtime.messageswithout pgdelta filter does create a plan like:With the new filter only the
CREATE INDEXin included in the plan.