From 1f3528552589182aec6e7f2ce9b94307e34c78c5 Mon Sep 17 00:00:00 2001 From: OllyNicholass Date: Wed, 19 Jun 2024 01:23:59 +0100 Subject: [PATCH] fix(#15): remove email field from profiles --- .../20240618233406_add_profile_trigger.sql | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/supabase/migrations/20240618233406_add_profile_trigger.sql b/supabase/migrations/20240618233406_add_profile_trigger.sql index 7c79111..baae3d6 100644 --- a/supabase/migrations/20240618233406_add_profile_trigger.sql +++ b/supabase/migrations/20240618233406_add_profile_trigger.sql @@ -1,20 +1,3 @@ -alter table "public"."profiles" add column "email" text; - -set check_function_bodies = off; - -CREATE OR REPLACE FUNCTION public.handle_new_user() - RETURNS trigger - LANGUAGE plpgsql - SECURITY DEFINER -AS $function$ -begin - insert into public.profiles (id, full_name, email) - values (new.id, new.raw_user_meta_data->>'full_name', new.email); - return new; -end; -$function$ -; - -- trigger the function every time a user is created create trigger on_auth_user_created after insert on auth.users