Execute optional commands before delete and after update.