Skip to content

fix(cli)!: stop migration new overwriting an existing migration (CLI-3323) - #7884

Open
7ttp wants to merge 1 commit into
nextfrom
7ttp/cli-3323-migration-new-can-overwrite-an-existing-file
Open

7ttp wants to merge 1 commit into
nextfrom
7ttp/cli-3323-migration-new-can-overwrite-an-existing-file

Conversation

@7ttp

@7ttp 7ttp commented Dec 1, 2026

Copy link
Copy Markdown
Member

TL;DR

stops supabase migration new overwriting a migration that already has the same timestamp and name

what might hurt the user?

running migration new <name> twice inside one second, from a script, an agent or two terminals, truncated the first file and the piped sql replaced it, while both runs printed Created new migration and exited 0

fixed by:

the file is now created exclusively, so a clash exits 1 with migration file already exists and a hint to rerun a second later, leaving the existing migration untouched

ref:

BREAKING CHANGE: supabase migration new <name> now exits 1 instead of overwriting when a migration with the same timestamp and name already exists, wait a second and rerun to create it

@7ttp 7ttp self-assigned this Dec 1, 2026
@7ttp
7ttp requested a review from a team as a code owner December 1, 2026 00:37
@7ttp
7ttp requested a review from mdonnalley December 1, 2026 00:37

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@a5638ed supplied to reviewers (advisory, not a style pass).

Both independent reviews completed and reported zero findings. The checked-out code creates migration files exclusively and returns a collision error before opening the existing file for stdin. The regression test checks that the original SQL is preserved and stdout stays empty. The existing reference overlay remains accurate, and no CLI reference prose changed. Tests were not run because the checkout lacks installed dependencies.

Findings

No issues found.

Stats

Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant