You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Views with security_invoker are being migrated without this option #3487
When creating a view remotely (supabase.com) with the security_invoker = true option, migrations to be applied locally do not come with this option.
To Reproduce
Create a view remotely (supabase.com)
CREATEVIEWtest_security WITH (security_invoker) asSELECT2as value;
Locally pull migrations
supabase db pull
Note that migrations do not come with the security invoker = true option
+ create or replace view "public"."test_security" as SELECT 2 AS value;- create or replace view "public"."test_security" WITH ("security_invoker"='true') as SELECT 2 AS value;
Expected behavior
The migration should go like this:
create or replaceview "public"."test_security" WITH ("security_invoker"='true') asSELECT2AS value;
System information
OS: Windows
Version of supabase-js: 2.39.3
Version of Node.js: v18.18.2
Reacted by Igor Lanko, Stephen Nease, desinox, wiglo-admin, Takuya Fukuju, SlavenDj and Goszczu
Thanks for reporting this, I just uncovered this myself too, unfortunately.
I think you summed it up really well, but just a few additional (maybe obvious) details about the issue:
the with (security_invoker) argument is missing in the schema of the view in the Supabase UI too;
neither the auto migration supabase db diff -f includes that in the migration script, nor does it detect it as a change to the view if modified from the Supabase's SQL editor.
Hi @Hallidayo this is in fact still an issue. Not a big deal to manually change the migration after it gets generated but it'd be much more convenient if the view's permissions were included by default.
Activity
igorlanko commentedon Apr 9, 2024
Thanks for reporting this, I just uncovered this myself too, unfortunately.
I think you summed it up really well, but just a few additional (maybe obvious) details about the issue:
with (security_invoker)argument is missing in the schema of the view in the Supabase UI too;supabase db diff -fincludes that in the migration script, nor does it detect it as a change to the view if modified from the Supabase's SQL editor.Update: there's also actually a related discussion over here https://github.com/orgs/supabase/discussions/901#discussioncomment-6517175.
Hallidayo commentedon Feb 23, 2025
Hi all, Just checking in here are you still experiencing this?
FrostedBiscuit commentedon Feb 24, 2025
Hi @Hallidayo this is in fact still an issue. Not a big deal to manually change the migration after it gets generated but it'd be much more convenient if the view's permissions were included by default.
Hallidayo commentedon Apr 25, 2025
Transferred from the supabase repo.
sweatybridge commentedon Apr 27, 2025
closing as duplicate