- Imagine you have 2 models (city and country) with nested attributes feature, then the model country has n cities, the principal validation is that a for each record, the language is unique
- create unique index
rails g migration AddIndexToCity
class AddIndexToCity < ActiveRecord::Migration[5.2]