You can create the table and index with the generator without changing the migration file
For a unique index
rails generate model CreateFoos bar:string:uniq
For a non-unique index
rails generate model CreateFoos bar:string:index
You can create the table and index with the generator without changing the migration file
For a unique index
rails generate model CreateFoos bar:string:uniq
For a non-unique index
rails generate model CreateFoos bar:string:index