Created
October 10, 2022 07:06
-
-
Save nikolasburk/2744cf4dd63fd2a6abd8c019c8d4ccdb 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
grant usage on schema public to supabase_auth_admin; | |
grant all on public."Profile" to supabase_auth_admin; | |
create or replace function create_profile_on_user_creation() returns trigger as | |
$$ | |
begin | |
insert into | |
public."Profile"(id, "modifiedAt") | |
values(new.id, current_timestamp); | |
return new; | |
end; | |
$$ | |
language plpgsql; | |
create trigger create_user | |
after insert on auth.users | |
for each row | |
execute procedure create_profile_on_user_creation(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment