I have added a validation like this one to my model:

```
validates :name, uniqueness: {scope: user_id}

```

And added an add\_index like this on my migration:

```
add_index(:posts, :name)

```

But I just read on the rails api [page](http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#method-i-validates_uniqueness_of) the part about data integrity.

And I was wondering if I will have any integrity errors on my models, so my question is: should I rewrite my indexes as?

add\_index(:posts, [:name, :user\_id]), unique: true

Thanks all,