Skip to content

CLI: supabase db diff doesn't handle custom domains #3264

@davidaventimiglia-professional

Description

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The Supabase CLI supabase db diff command to to a DB diff and generate migration files, does not seem to handle PostgreSQL custom domains (https://www.postgresql.org/docs/current/sql-createdomain.html). Specifically, what I observed is the following. If I create a custom domain, then create a table with a column using that custom domain, the do supabase db diff, the DDL for creating the table is generated, but not the DDL for creating the domain. Consequently, a migration file created in this way is invalid and will fail. I tried it with the default, with --use-migra, with --use-pg-diff, and with --use-pgadmin and got the same result.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Install the Supabase CLI.
  2. Initialize a project directory with supabase init.
  3. Start local development with supabase start.
  4. Connect to the local db with psql: psql $(supabase status --output json 2>/dev/null | jq -r '.DB_URL')
  5. Create a custom domain: create domain foo as text
  6. Create a table with the domain: create table bar (name foo)
  7. Exit to a shell and generate a diff: supabase db diff
  8. Observe that the diff has the create table statement but no create domain statement.

Expected behavior

I expected at least one of the diff tools to detect that DDL for custom domains needs to be emitted.

Screenshots

no applicable screenshots

System information

  • OS: Ubuntu 24.0.2
  • Version of supabase-js: 2.15.8
  • Version of Node.js: (running supabase cli binary)

Additional context

no other context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions