Skip to content

feat(cli): prototype migration security checks and db advisors --baseline - #7368

Draft
avallete wants to merge 2 commits into
mikedonnalley/cli-2784-init-migration-checksfrom
avallete/migration-checks-e2e-poc
Draft

avallete wants to merge 2 commits into
mikedonnalley/cli-2784-init-migration-checksfrom
avallete/migration-checks-e2e-poc

Conversation

@avallete

@avallete avallete commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Draft prototype for secure-by-default migrations, stacked on #7349. Not for merge as is.
baseline
fix_flow
warn

What it does

  • Runs @supabase/pg-checks (preview build) when migrations are applied: db push, migration up, migration down, db reset, start, and declarative sync.
  • Findings at error roll the file back (SB001); warn findings are reported. Files that run outside a transaction are checked after commit and fail with "already committed".
  • --skip-checks on every command above.
  • supabase db advisors --baseline writes current findings into [db.migrations.checks.exclude] (local, --remote, --remote=<db-url>), sorted and idempotent.
  • Each finding shows the fix suggestions from pg-checks (Fix: / Or: with SQL), printed once per rule per message.

Open questions

  • Whether pre-existing findings should block (currently they do; the message points to --baseline).
  • db reset / start / migration down fail after every migration is applied, so the database is left applied.
  • Depends on a pkg.pr.new preview of @supabase/pg-checks.

🤖 Generated with Claude Code

avallete and others added 2 commits October 28, 2026 13:07
…line

Draft prototype: run @supabase/pg-checks on migration apply (db push,
migration up/down, db reset, start, declarative sync), block on
error-level findings, add --skip-checks, and add
supabase db advisors --baseline to exclude existing findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation-checks' into avallete/migration-checks-e2e-poc

# Conflicts:
#	apps/cli/src/shared/init/project-init.templates.ts
#	apps/cli/src/shared/init/project-init.templates.unit.test.ts
@avallete avallete added the run-preview-packages Publish pkg.pr.new preview CLI packages for this PR label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@b8ea73a7de379e24b332a44435b1025066a9f72b

Preview package for commit b8ea73a.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-preview-packages Publish pkg.pr.new preview CLI packages for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant