S
Supabase2mo ago
Steve

ERROR: relation "query_results_extended" does not exist (SQLSTATE 42P01)

I get this error after running supabase db diff -f create_brand_visibility_averages_view:
ERROR: relation "query_results_extended" does not exist (SQLSTATE 42P01)`
ERROR: relation "query_results_extended" does not exist (SQLSTATE 42P01)`
But on my local supabase project the view exists and is shown in dashboard. I'm just folowing this Declarative database schemas tutorial.
Declarative database schemas | Supabase Docs
Manage your database schemas in one place and generate versioned migrations.
No description
5 Replies
dc_dalin
dc_dalin2mo ago
query_results_extended should be created first before brand_visibility_averages_view
ibrahim
ibrahim2mo ago
https://supabase.com/docs/reference/cli/supabase-db-diff you need to add the --local flag if diffing against local migration files
CLI Reference | Supabase Docs
CLI reference for the Supabase CLI
Steve
SteveOP2mo ago
I solved the issue but don’t remember what I did I think I deleted the migration history and did supabase db pull or something
ibrahim
ibrahim2mo ago
yeah that will reset it it to baseline which is always an option
Steve
SteveOP2mo ago
But yeah I don’t really like declarative schemas because they drop triggers in auth schemas and other non public schemas.

Did you find this page helpful?