Added unique constraints to database