cli icon indicating copy to clipboard operation
cli copied to clipboard

`supabase db diff` and `supabase db pull` not capturing RLS policies in views

Open officialankan opened this issue 1 year ago • 2 comments

Describe the bug I love views with RLS to reduce complex queries. I also like local development. When combining the two I always have to manually add the RLS part when pushing or pulling migrations.

To Reproduce Steps to reproduce the behavior:

  1. Create a view with RLS (security_invoker=true) remotely or localy.
  2. pull or push
  3. in the generated diff, the security_invoker is not always there (I have seen it sometime, but can't see why it won't show anymore)

Expected behavior The full settings of the view should be diffed.

System information bild

Much love! I really enjoy supabase.

officialankan avatar May 10 '24 05:05 officialankan

Is this a duplicate of #792?

sweatybridge avatar May 14 '24 14:05 sweatybridge

Is this a duplicate of #792?

Yes, it is...

officialankan avatar May 14 '24 16:05 officialankan

Thanks for confirming. I will close this issue as a duplicate.

The fix requires updating the underlying diff tool from migra to pg-schema-diff. It will likely be addressed by this upstream PR when it's merged https://github.com/stripe/pg-schema-diff/pull/132

sweatybridge avatar May 29 '24 04:05 sweatybridge

Thanks for confirming. I will close this issue as a duplicate.

The fix requires updating the underlying diff tool from migra to pg-schema-diff. It will likely be addressed by this upstream PR when it's merged https://github.com/stripe/pg-schema-diff/pull/132

pg-schema-diff doesn't support views yet. So that will need to be implemented first.

bplunkett-stripe avatar May 29 '24 20:05 bplunkett-stripe