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

CREATE DOMAIN not added to migration #2137

Open
2 tasks done
ChristianSi opened this issue Apr 9, 2024 · 0 comments
Open
2 tasks done

CREATE DOMAIN not added to migration #2137

ChristianSi opened this issue Apr 9, 2024 · 0 comments
Labels
bug Something isn't working migration

Comments

@ChristianSi
Copy link

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

As Media Type Handlers documents, a CREATE DOMAIN command is needed to return custom media types. However, supabase db diff does not add these commands to the generated migration, so pushing the migration to other systems will fail.

To Reproduce

Create a custom domain and a function returning it, for example:

create domain "text/plain" as text;

CREATE OR REPLACE FUNCTION echo_service(input text)
 RETURNS "text/plain"
 LANGUAGE plpgsql
AS $function$declare
begin
  -- Echo input back as plain text
  perform set_config('response.headers', '[{"Content-Type": "text/plain"}]', true);
  return input;
end;$function$
;

Create a migration calling supabase db diff --local.

Expected behavior

Both the create domain and the CREATE OR REPLACE FUNCTION commands are added to the migration.

Actual behavior

Only the CREATE OR REPLACE FUNCTION command is added to the migration.

As a result, ERROR: 42704: type "text/plain" does not exist will be thrown if trying to apply the migration elsewhere.

System information

All/latest.

@ChristianSi ChristianSi added the bug Something isn't working label Apr 9, 2024
@saltcod saltcod transferred this issue from supabase/supabase Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working migration
Projects
None yet
Development

No branches or pull requests

2 participants