How do I get the id of a deleted user in a trigger function?
When deleting a user I want to clean up all the rows related to that user with a trigger function but I can't find any documentation of how that is done.
This is the function I want to invoke but for it to work I need to know the id of the deleted user. It's not
:
```
begin
delete from public.bets where user_id=@id; <-- This isn't working
delete from public.final_bets where user_id=$id; <-- neither is this
delete from public.profiles where id=auth.user.uid; or this for that matter
end;
This is the function I want to invoke but for it to work I need to know the id of the deleted user. It's not
@id ```
begin
delete from public.bets where user_id=@id; <-- This isn't working
delete from public.final_bets where user_id=$id; <-- neither is this
delete from public.profiles where id=auth.user.uid; or this for that matter
end;