Skip to content

fix(cli): order migrations consistently - #6225

Merged
7ttp merged 5 commits into
developfrom
fix/migration-version-order-consumers
Aug 17, 2026
Merged

fix(cli): order migrations consistently#6225
7ttp merged 5 commits into
developfrom
fix/migration-version-order-consumers

Conversation

@7ttp

@7ttp 7ttp commented Aug 16, 2026

Copy link
Copy Markdown
Member

TL;DR

#6038 sorted migrations by version for db push and migration up but left three sibling consumers reading the same data in file name order.

what's broken?

  • migration list renders 2 migrations as 3 rows, one version shown as both remote only and local only
  • db pull flags an in-sync tree as a conflict and asks to repair the same version both reverted and applied
  • db reset / db start / the shadow db replay migrations in the reverse of the order db push applies

why was it biting?

The database returns migrations sorted by version, the files come back sorted by filename, and the two disagree whenever one version starts another: 20260420010000_b sorts first by filename, second by version.
our earlier fix sorted only the list db push reads, so the rest kept comparing the two orders as if they matched...

fixed now by:

One shared version sorter applied at the list merge, the pull reconcile walk, and the two replay owners.

invoked as before now
migration list 3 rows for 2 migrations 2 paired rows
db pull false conflict, contradictory advice in-sync
db reset / db diff replay reverse of db push same as db push

ref:

@7ttp
7ttp requested a review from a team as a code owner August 16, 2026 21:49
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

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

Preview package for commit 6798385.

@7ttp 7ttp self-assigned this Aug 16, 2026
@avallete
avallete enabled auto-merge August 17, 2026 17:03
# Conflicts:
#	apps/cli/src/legacy/shared/legacy-migrate-and-seed.unit.test.ts
@7ttp

7ttp commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

thanks @avallete :) 💚

@7ttp
7ttp disabled auto-merge August 17, 2026 17:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98d86e5983

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/cli/src/legacy/commands/migration/list/list.format.ts Outdated
@7ttp
7ttp enabled auto-merge August 17, 2026 17:54
@7ttp
7ttp added this pull request to the merge queue Aug 17, 2026
Merged via the queue into develop with commit 4c6a165 Aug 17, 2026
21 checks passed
@7ttp
7ttp deleted the fix/migration-version-order-consumers branch August 17, 2026 18:10
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.

3 participants