Repository navigation
Description
Affected area
Migrations
Supabase CLI version
3.4.0-beta.5
Operating system
Windows 11 x64, build 26200
Installation method
Official GitHub release binary (windows_amd64)
Command
supabase.exe migration list --remote="<disposable-loopback-db-url>"
supabase.exe db pull --remote="<disposable-loopback-db-url>"Actual output
migration list prints 20260420 on two separate rows, once local-only and once remote-only. db pull exits 1 and prints the following after the target line:
The remote database's migration history does not match local files in supabase/migrations directory.
Make sure your local git repo is up-to-date. If the error persists, try repairing the migration history table:
supabase migration repair --status reverted 20260420 --remote=<db-url>
supabase migration repair --status applied 20260101000000 --remote=<db-url>
supabase migration repair --status applied 20260420 --remote=<db-url>
Expected behavior
20260420 and 20260420010000 should each appear as one matched row. Only 20260101000000 is missing from the database ledger. db pull should identify that mismatch and omit repair advice for the two versions already present on both sides.
Steps to reproduce
-
In a disposable directory, create
supabase/config.tomlcontainingproject_id = "migration-merge-probe". Undersupabase/migrations/, create these three files, each withselect 1;as its contents:20260101000000_example.sql 20260420_example.sql 20260420010000_example.sql -
In a disposable PostgreSQL database reachable over loopback, create the migration ledger:
CREATE SCHEMA supabase_migrations; CREATE TABLE supabase_migrations.schema_migrations ( version text PRIMARY KEY, name text, statements text[] ); INSERT INTO supabase_migrations.schema_migrations (version) VALUES ('20260420'), ('20260420010000');
-
From the fixture directory, run the commands above with the disposable database URL. The reported
db pullfailure occurs during migration history reconciliation, before schema diffing.
Additional context
Reproduced during AI-assisted triage with the official Windows release binary and PGlite 0.6.0 over a local PostgreSQL socket. Removing only the January file makes migration list show both shared versions correctly. With the original three-file fixture, db push --dry-run correctly identifies only the January migration as unapplied. The fixture ledger was unchanged after these commands.
The same comparison behavior is present at develop commit 17e8cbf410d07826e73c484390af7c3547dc4fb7. The inputs are ordered by text version, but the two merge loops compare parsed integers. After consuming the extra January file, a loop can advance past the remote 20260420 row before it reaches the identical local version. History reconciliation · Migration list
Related to #6036 and #6225. That fix aligned filename and version sort order. This fixture adds one genuinely local-only migration and exposes the remaining mismatch between the sort and comparison rules.
Activity
fix(cli): pair mixed width migration versions (CLI-3205) (supabase#7781)