restructure not null query

Fixes https://github.com/ongoworks/rocker-docker/issues/20