Added unique constraints to db