Error: relation 'supabase_migrations.schema_migrations' does not exist #47627
Replies: 1 comment
-
|
This error appears in the Postgres logs when the Supabase dashboard polls for migration history and the supabase_migrations schema has not been initialized. It is a dashboard polling artifact and does not mean your migrations are broken. It happens most often in three situations: (1) a project that was created before the migration tracking schema was introduced, (2) a self-hosted instance where the initial migration setup step was skipped, or (3) a project restored from a pg_dump that did not include the supabase_migrations schema. To initialize the schema: CREATE SCHEMA IF NOT EXISTS supabase_migrations; CREATE TABLE IF NOT EXISTS supabase_migrations.schema_migrations ( After creating the table the polling error disappears from the logs. If you are using the Supabase CLI, running supabase db push against a linked project also creates this schema automatically. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a copy of a troubleshooting article on Supabase's docs site. It may be missing some details from the original. View the original article.
If you are observing the error
relation "supabase_migrations.schema_migrations" does not existin your Postgres logs, it is typically caused by the Supabase dashboard polling for migration history.Why Does This Happen?
The Supabase dashboard performs background queries to retrieve migration data from a table that is managed specifically by the Supabase CLI. If you are using a custom migration tool, a manual setup, or have not yet deployed migrations via the CLI, this table will not exist, causing the logs to report this error.
How to Resolve:
supabase db pushwill create the supabase_migrations schema and schema_migrations table as part of applying your local migrations. Be aware that this command may also apply any pending migration files to your database, so only run it if that's your intended workflow.Beta Was this translation helpful? Give feedback.
All reactions