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