Skip to content

Instantly share code, notes, and snippets.

@itoonx
Created November 24, 2024 04:06
Show Gist options
  • Save itoonx/23dc549c5aedc0462b5b1fa82925d659 to your computer and use it in GitHub Desktop.
Save itoonx/23dc549c5aedc0462b5b1fa82925d659 to your computer and use it in GitHub Desktop.
CREATE OR REPLACE FUNCTION "public"."create_profile_on_signup"() RETURNS "trigger"
LANGUAGE "plpgsql" SECURITY DEFINER
AS $$begin
INSERT INTO public.profile (id)
VALUES (
NEW.id
);
RETURN NEW;
end;$$;
create trigger create_profile_on_signup after insert on auth.users for each row execute function create_profile_on_signup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment