Skip to content

Views with security_invoker are being migrated without this option #3487

@luizzappa

Description

@luizzappa

Bug report

  • [ X ] I confirm this is a bug with Supabase, not with my own application.
  • [ X ] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

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

  1. Create a view remotely (supabase.com)
CREATE VIEW test_security WITH (security_invoker) as SELECT 2 as value;
  1. Locally pull migrations
supabase db pull
  1. 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 replace view "public"."test_security" WITH ("security_invoker"='true') as  SELECT 2 AS value;

System information

  • OS: Windows
  • Version of supabase-js: 2.39.3
  • Version of Node.js: v18.18.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions