"Remote migration versions not found in local migrations directory": when migrations applied by hand break supabase db push A developer documented three ways that out-of-band SQL execution breaks `supabase db push` and the Supabase GitHub integration: MCP tools record timestamp versions with no matching file, SQL-editor runs record nothing, and duplicate numeric prefixes collide on the `schema_migrations` primary key. After hitting all three in one production CRM project, the developer ported the CLI's `findPendingMigrations` matching logic to JavaScript to reproduce each failure mode and recommended a one-time repair of the migration records followed by routing all production migrations through the integration only. supabase db push and the Supabase GitHub integration decides which migrations to run by comparing two lists: the versions recorded in the schema migrations table in the supabase migrations schema on the database, and the numeric prefixes of your migration files , such as 0017 in 0017 report self delete.sql . Anything that applies SQL without recording the same version breaks that comparison. A migration applied through an MCP tool records a timestamp version the files don't have, so push fails with "Remote migration versions not found in local migrations directory" . A migration pasted into the SQL editor records nothing, so the CLI sees local files missing from the middle of the history. And two branches that both add 0017 collide on the version column, which is the table's primary key. I hit all three in one production project and reproduced each with the CLI's own matching code. The fix is a one-time repair of the records , then one rule: production migrations go through the integration only . The database had the right tables. Its record of how they got there didn't match the files. The CLI reads every version from that table, in order, parses each local file name as