supabase db pull --declarative skips schema if extension is created in a schema without any additional object
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- postgresql, typescript
Research direction
The issue is in the declarative schema sync logic when an extension is created in a new, empty schema. Look at the code that handles supabase db pull --declarative and supabase db schema declarative sync, likely in the database migration or schema planning modules. Examine how the load order for SQL files is determined, particularly for extensions and schema creation. The goal is to ensure the schema creation statement is ordered before the extension creation that depends on it.
Written by the indexing model from the issue text.
Description
Affected area
Database
Supabase CLI version
v2.117.0
Operating system
macOS
Installation method
brew
Command
supabase db pull --declarative --local
supabase db schema declarative sync
Actual output
Declarative schema planning failed: shadow load stuck after 10 round(s): 1 file(s) cannot apply
- _cluster/extensions/pgmq.sql: schema "pgmq" does not exist — at line 1: CREATE EXTENSION "pgmq" SCHEMA "pgmq" (failed identically in 10 round(s) — likely a genuine missing dependency, not ordering)
- Default load order stuck; reordered (statement-kind).
stuck _cluster/extensions/pgmq.sql:1 CREATE EXTENSION "pgmq" SCHEMA "pgmq" (schema "pgmq" does not exist)
after _cluster/extensions/btree_gin.sql:1 CREATE EXTENSION "btree_gin" SCHEMA "extensions";
Set loadOrder on .pgdelta-export.json to put _cluster/extensions/btree_gin.sql before _cluster/extensions/pgmq.sql.
Expected behavior
Migration file to be created.
Steps to reproduce
- Execute the following sql on the supabase database:
CREATE SCHEMA "pgmq";
CREATE EXTENSION "pgmq" SCHEMA "pgmq";
- Execute
supabase db pull --declarative --local - Execute
supabase db schema declarative sync
Crash report ID
No response
Docker and service versions
Additional context
No response
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 523
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 268
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/cli
-
🐛 Bug supabase/cli
-
🐛 Bug supabase/cli
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
bug supabase/cli
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
🐛 Bug supabase/cli
-
🐛 Bug supabase/cli
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100