Last active
April 10, 2024 19:25
-
-
Save allipiopereira/75d89757730466ff1bf4ac5b28f06041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function update_profile () returns trigger security definer language plpgsql as $$ | |
begin | |
update public.profiles | |
set email = new.email | |
where id = new.id; | |
return new; | |
end; | |
$$; | |
create trigger update_profile_trigger | |
after | |
update on auth.users for each row | |
execute function public.update_profile (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment