Supabase CLI migration error: relation already exists after failed upgrade
26K reputation · 07 Apr 2022, 03:43 UTC
After a Supabase migration fails with the error “relation already exists”, the CLI records the last good version in supabase_migrations but it is unclear whether it automatically removes any temporary database objects that were created during the failed run.
The documentation does not guarantee cleanup of orphaned indexes, constraints or other schema artifacts, leaving open the possibility of schema drift if such objects remain.
What is the expected CLI behavior regarding cleanup after a failure, and is manual inspection or removal required to ensure a clean state?