Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
davidaventimiglia-professional opened this issue Mar 5, 2025 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@davidaventimiglia-professional

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

@davidaventimiglia-professional davidaventimiglia-professional added the bug Something isn't working label Mar 5, 2025
@w3b6x9 w3b6x9 transferred this issue from supabase/supabase Mar 6, 2025
@Hallidayo
Copy link

Hi, I've moved this issue over from the supabase repo as it seems like a cli issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants