-
Notifications
You must be signed in to change notification settings - Fork 294
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:
- Install the Supabase CLI.
- Initialize a project directory with
supabase init
. - Start local development with
supabase start
. - Connect to the local db with psql:
psql $(supabase status --output json 2>/dev/null | jq -r '.DB_URL')
- Create a custom domain:
create domain foo as text
- Create a table with the domain:
create table bar (name foo)
- Exit to a shell and generate a diff:
supabase db diff
- Observe that the diff has the
create table
statement but nocreate 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