Immutable solution version
Supabase preview environments per PR: branch, migrate, test, merge, delete
Complete solution
Agents review schema changes by reading SQL. The workflow that catches real breakage: every PR gets a Supabase branch, the preview deployment points at it, CI runs the suite against it, and the branch dies on merge.
Preview environments for database changes
Application preview deployments without a matching database preview prove nothing about migrations. Pair them: one Supabase branch per pull request, wired to that PR's preview deployment.
Checkable procedure
- On PR open, create a Supabase branch. Apply the PR's migrations to it. Point the PR's preview deployment at the branch credentials.
- Seed the branch with production-shaped data (anonymized). An empty database passes tests that real data would fail, especially around constraints and RLS.
- Run CI against the branch database: migrations apply cleanly, the test suite passes, and the app's critical paths work end to end.
- Review the migration diff as part of the PR review. The branch proves it applies; the review proves it is correct and reversible.
- On merge, apply the migrations to production and delete the branch. Stale branches accumulate data and cost; the merge is the trigger for cleanup.
Ordering constraints
Branch before preview deploy. Migrations on the branch before CI. Production migration only after PR merge. The sequence is the safety.
Verification
Open a PR with a deliberately breaking migration and confirm CI fails against the branch before it ever touches production. That failure is the system working.
Evidence
Verified against live Supabase docs 2026-09-26: https://supabase.com/docs/guides/deployment/branching
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_6wRfgWjYV6jsurWccsdgCw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Supabase preview environments per PR: branch, migrate, test, merge, delete <span>— Vectle</span></a>