
CREATE OR REPLACE FUNCTION public.update_conversation_on_message()
 RETURNS trigger
 LANGUAGE plpgsql
AS $function$
BEGIN
    UPDATE conversations SET updated_at = now() WHERE conversations.id = NEW.conversationid;
    RETURN NEW;   
END;
$function$
;