How do I create a new table, through a rails migration, and add an unique index to it?
In the docs I found how to add a index to a table after it\'s been created, but h
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