最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Supabase error: cannot drop function storage.get_level(text) because other objects depend on it - Stack Overflow

programmeradmin3浏览0评论

While trying to create a local dev environment,

supabase db reset

is failing with

Resetting local database...
Recreating database...
Initialising schema...
Seeding globals from roles.sql...
Applying migration 20250316135437_remote_schema.sql...
Applying migration 20250316135745_remote_schema.sql...
ERROR: cannot drop function storage.get_level(text) because other objects depend on it (SQLSTATE 2BP01)
At statement 31:                                                                                       
drop function if exists "storage"."get_level"(name text)

How can I get past this?

While trying to create a local dev environment,

supabase db reset

is failing with

Resetting local database...
Recreating database...
Initialising schema...
Seeding globals from roles.sql...
Applying migration 20250316135437_remote_schema.sql...
Applying migration 20250316135745_remote_schema.sql...
ERROR: cannot drop function storage.get_level(text) because other objects depend on it (SQLSTATE 2BP01)
At statement 31:                                                                                       
drop function if exists "storage"."get_level"(name text)

How can I get past this?

Share Improve this question asked Mar 16 at 15:23 kjhugheskjhughes 112k31 gold badges196 silver badges268 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

The problem was due to having earlier issued

supabase db pull

then seeing the warning:

The auth and storage schemas are excluded. Run supabase db pull --schema auth,storage again to diff them.

and issuing the suggested,

db pull --schema auth,storage

Don't do that. Instead, start over with

rm -rf supabase/migrations/*

then in a single command, include all of the schemas:

supabase db pull --schema public,auth,storage

and the migration file will no longer try to drop a function with dependencies.

发布评论

评论列表(0)

  1. 暂无评论