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
@id
@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;
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.