move uniq constraint into a scope