Add unique constraint

ready for review