Added unique constraint to entities