had this issue where leads were sitting in 'new' for days because the workflow only updated the status but not when it actually happened. i started using a simple sql trigger on the database side to
always update a modified_at column whenever the status field changes. it's much more reliable than relying on the app layer to handle the timestamp correctly every single time.
CREATE TRIGGER update_lead_timestampBEFORE UPDATE ON leadsFOR EACH ROWBEGINIF NEW.status <> OLD.status THENSET NEW.updated_at = NOW();END IF;END;
does anyone else trust the app logic for these kinds of timestamps?