fix: fix function for signups
This commit is contained in:
12
supabase/migrations/20250612153946_fix-signup.sql
Normal file
12
supabase/migrations/20250612153946_fix-signup.sql
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
CREATE OR REPLACE FUNCTION handle_new_user()
|
||||||
|
RETURNS trigger
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
SECURITY DEFINER
|
||||||
|
SET search_path = ''
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO public.users (id)
|
||||||
|
VALUES (NEW.id);
|
||||||
|
RETURN NEW;
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
@@ -17,8 +17,8 @@ LANGUAGE plpgsql
|
|||||||
SET search_path = ''
|
SET search_path = ''
|
||||||
AS $$
|
AS $$
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO public.users (id, contact_email)
|
INSERT INTO public.users (id)
|
||||||
VALUES (NEW.id, NEW.email);
|
VALUES (NEW.id);
|
||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|||||||
Reference in New Issue
Block a user