Suppose I created a table table in a Rails app. Some time later, I add a column running:
table
rails generate migration AddUser_idColumnToTable user_i
Add in the generated migration after creating the column the following (example)
add_index :photographers, :email, :unique => true