In Rails 4+, indexes associated with a column are automatically renamed when the column is renamed.
If you get the error "Index name [...] on table 'foo' is too long; the limit is 63 characters", first rename the index manually to something shorter.
rename_index :table_name, "oldname", "newname"
rename_column :table, :old_column, :new_column
👉 Source