Skip to content

Move the empty-string checks migration after the last one hosted applied - #167

Merged
davidtaing merged 1 commit into
mainfrom
fix-migration-order
Oct 7, 2026
Merged

davidtaing merged 1 commit into
mainfrom
fix-migration-order

Conversation

@davidtaing

Copy link
Copy Markdown
Collaborator

Why

Every Vercel Deploy run since #152 merged has failed at the migration step:

Found local migration files to be inserted before the last migration on remote database.
Rerun the command with --include-all flag to apply these migrations:
supabase/migrations/20260912133715_add_empty_string_checks.sql

#152's migration is timestamped 20260912133715, but it merged after #154's 20260914080000 had already been applied to the hosted project. db push will not insert a migration before the last one the remote has applied, so production is stuck at the commit before #152.

What

Renames the file to 20261007100000_add_empty_string_checks.sql. The contents are unchanged. Hosted never applied the old name, so its schema_migrations has no entry to reconcile.

I chose a rename over adding --include-all to the deploy step. AGENTS.md treats that flag as a deliberate repair, and leaving it on would also let a future out-of-order migration through without anyone noticing. The rename also keeps local replay order the same as the order hosted applied the migrations in.

Checked

  • pnpm db:reset applies every migration in the new order without errors.
  • pnpm test:db: 18 files and 271 tests passed, exit 0.

Not checked: whether any hosted row already has a blank practitioners.name or practitioner_contacts.contact_email. If one does, the constraint will fail to add and the push will fail again, for a different reason.

#152's migration was timestamped 20260912133715 but merged after #154's 20260914080000 had already reached the hosted project, so supabase db push refuses it as out of order and the deploy fails before building. Renaming it to a later timestamp lets the push apply it normally, and keeps local replay order the same as hosted order. Hosted never applied the old name, so nothing there records it.
@davidtaing
davidtaing marked this pull request as ready for review October 7, 2026 09:12
@davidtaing
davidtaing merged commit 405ef3e into main Oct 7, 2026
4 checks passed
@davidtaing
davidtaing deleted the fix-migration-order branch October 7, 2026 09:15
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