Why does db diff --linked show REVOKE statements after db reset, and why did applying them break my

I'm using Supabase CLI for local development. I encountered a confusing situation with database migrations and permissions that broke my app.

After running supabase db reset on both local and remote databases, supabase db diff --linked still showed differences, specifically, hundreds of REVOKE statements for all tables across anon, authenticated, and service_role roles and FUNCTION definitions. I can say that the functions existed both, locally and remotely.

In order to fix my app I did:

grant usage on schema public to anon, authenticated, service_role; grant all on all tables in schema public to anon, authenticated, service_role; grant all on all routines in schema public to anon, authenticated, service_role; grant all on all sequences in schema public to anon, authenticated, service_role; alter default privileges for role postgres in schema public grant all on tables to anon, authenticated, service_role; alter default privileges for role postgres in schema public grant all on routines to anon, authenticated, service_role; alter default privileges for role postgres in schema public grant all on sequences to anon, authenticated, service_role;

So... I am extremelly confused right now.

Why did supabase db diff --linked generate all these REVOKE statements after resetting both databases from the same migration files?
Is there a difference in how Supabase's local environment handles permissions vs remote? Does local apply some default security hardening that remote doesn't?
How do you guys deal with remote vs local Supabase development?

Thanks in advance.
Was this page helpful?