Review Supabase migration and permission safety when troubleshooting a Supabase or PostgREST 42501, editing supabase/migrations/*.sql or RLS policies, preparing supabase db push, or running vercel deploy with Supabase environment variables. Applies to migration and permission work in development, preview, and production.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Supabase Migration Safety?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ohad6k-supabase-migration-safety)
---
name: supabase-migration-safety
description: >-
Review Supabase migration and permission safety when troubleshooting a
Supabase or PostgREST 42501, editing supabase/migrations/*.sql or RLS policies,
preparing supabase db push, or running vercel deploy with Supabase environment
variables. Applies to migration and permission work in development, preview,
and production.
---
# Supabase migration and permission safety
1. Identify the exact error, operation, caller role, project and deployment target. Table permission errors usually point to object grants, schema errors to schema USAGE, and row-policy errors to RLS. A SELECT blocked by row filtering can return an empty list. Preserve RLS and use only the grants the intended caller needs.
2. For API-exposed tables, review explicit operation-level grants, RLS enablement and policies together. Check USING for existing rows and WITH CHECK for new row values. Verify allow and deny behavior for the intended role with synthetic accounts and an owner-approved target.
3. Before `supabase db push`, confirm the linked project or explicit target. Compare local and remote migration history and use the dry-run to review pending SQL. Prefer a local or preview rehearsal.
4. Before deploying, confirm Vercel project, target and branch scope. Use the intended Supabase project URL with its matching client publishable key. Keep Supabase secrets and service-role keys server-side. Rebuild and redeploy when build-time env values change.
5. When checking a local migration diff, use `npx -y viberaven@1.20.2 check` from the repo root if the checker is available or the user allows the install. For public or synthetic SQL, the hosted `check_supabase_migrations` tool can return findings with its coverage. Use `search_guides` for a redacted provider error. These checks provide scoped repo or documentation evidence. Claim live verification only after observing the intended request in the intended environment.
- [Supabase 42501 troubleshooting](https://supabase.com/kb/troubleshooting/database-api-42501-errors)
- [Supabase API security](https://supabase.com/docs/guides/api/securing-your-api)
- [Supabase migrations](https://supabase.com/docs/guides/deployment/database-migrations)
- [Vercel environment variables](https://vercel.com/docs/environment-variables)