supabase db pull
hello,
i am having issues pulling my production database schema to my local supabase instance.
when i originally pull the schema:
this needs to be manually fixed by altering
then, when i pull with
i am having issues pulling my production database schema to my local supabase instance.
when i originally pull the schema:
Seeding globals from roles.sql...
Applying migration 20250107080821_remote_schema.sql...
Applying migration 20250109023135_remote_schema.sql...
Applying migration 20250120014743_remote_schema.sql...
Applying migration 20250120015606_remote_schema.sql...
Applying migration 20250120015721_remote_schema.sql...
Applying migration 20250122030752_remote_schema.sql...
ERROR: relation "users" does not exist (SQLSTATE 42P01)
At statement 11: alter table "public"."customers" add constraint "customers_id_fkey" FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE not validSeeding globals from roles.sql...
Applying migration 20250107080821_remote_schema.sql...
Applying migration 20250109023135_remote_schema.sql...
Applying migration 20250120014743_remote_schema.sql...
Applying migration 20250120015606_remote_schema.sql...
Applying migration 20250120015721_remote_schema.sql...
Applying migration 20250122030752_remote_schema.sql...
ERROR: relation "users" does not exist (SQLSTATE 42P01)
At statement 11: alter table "public"."customers" add constraint "customers_id_fkey" FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE not validthis needs to be manually fixed by altering
users(id)users(id) to auth.users(id)auth.users(id) to workthen, when i pull with
--schema auth,storage--schema auth,storage, alter the migrations file so that it will pull, and then run supabase db resetsupabase db reset, i getResetting local database...
Recreating database...
Setting up initial schema...
Seeding globals from roles.sql...
Applying migration 20250107080821_remote_schema.sql...
Applying migration 20250109023135_remote_schema.sql...
Applying migration 20250120014743_remote_schema.sql...
Applying migration 20250120015606_remote_schema.sql...
Applying migration 20250120015721_remote_schema.sql...
Applying migration 20250122030752_remote_schema.sql...
Applying migration 20250122030935_remote_schema.sql...
ERROR: type "code_challenge_method" does not exist (SQLSTATE 42704)
At statement 11: alter table "auth"."flow_state" alter column "code_challenge_method" set data type code_challenge_method using "code_challenge_method"::text::code_challenge_method
Try rerunning the command with --debug to troubleshoot the error.Resetting local database...
Recreating database...
Setting up initial schema...
Seeding globals from roles.sql...
Applying migration 20250107080821_remote_schema.sql...
Applying migration 20250109023135_remote_schema.sql...
Applying migration 20250120014743_remote_schema.sql...
Applying migration 20250120015606_remote_schema.sql...
Applying migration 20250120015721_remote_schema.sql...
Applying migration 20250122030752_remote_schema.sql...
Applying migration 20250122030935_remote_schema.sql...
ERROR: type "code_challenge_method" does not exist (SQLSTATE 42704)
At statement 11: alter table "auth"."flow_state" alter column "code_challenge_method" set data type code_challenge_method using "code_challenge_method"::text::code_challenge_method
Try rerunning the command with --debug to troubleshoot the error.