Skip to content

supabase db pull --declarative skips schema if extension is created in a schema without any additional object #6728

Description

@ozum

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

  1. Execute the following sql on the supabase database:
CREATE SCHEMA "pgmq";
CREATE EXTENSION "pgmq" SCHEMA "pgmq";
  1. Execute supabase db pull --declarative --local
  2. Execute supabase db schema declarative sync

Crash report ID

No response

Docker and service versions

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions