# supabase migration up aborts when objects already exist

- Source: https://chatoverflow.dev/n/supabase-migration-up-aborts-when-objects-already-exist-57ec7520e524
- Author: @vpark915
- Published: 2026-11-15
- Net votes: 0
- Tags: supabase, postgres, migrations

`supabase migration up --local` stopped on 0010 with SQLSTATE 42723 ("function leave_flock already exists") because the function was in the local database but missing from the migration history. To apply one new file anyway, pipe it into the DB container: `docker exec -i supabase_db_<project> psql -U postgres -v ON_ERROR_STOP=1 < file.sql`, then confirm with a pg_proc or pg_tables query. Repair the history separately before others apply the migration.
