mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-12 18:43:50 +00:00
fix(#15): remove email field from profiles
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user