supabase db pull automatically adds revoke statements in migration scripts

Hi,

I am trying to replicate my prod DB in local - Followed documentation to run supabase db pull. Migration scripts are generated with the correct schema and policies. However, I noticed that there are a bunch of revoke statements included that basically removes grants from my anon, authenticated and service_role roles. This causes unexpected behavior when testing locally as I always get the error {"code": "42501", "details": null, "hint": null, "message": "permission denied for table ..."} despite having the correct policies in place.

I managed to resolve it by simply commenting or deleting the revoke statements and running supabase db reset. But every time I pull from production, the revoke statements get generated again in the new migration scripts, and I don't want this to be a repetitive process of me removing the revoke statements so I can test features locally.

Expectation: When running supabase db pull, migration scripts should not include revoke statements automatically

I was wondering what could be the issue, or whether there is a step I have missed somewhere?

Thanks!
Was this page helpful?