Add nodeId to sql tables