Will removing a column with a Rails migration remove indexes associated with the column

前端 未结 6 846
一个人的身影
一个人的身影 2021-01-07 15:46

In Rails 2, will removing a column with a Rails migration also change/remove indexes associated with the column? If not, and instead you have to also change/remove each ind

6条回答
  •  执念已碎
    2021-01-07 16:27

    If you want to remove index you should use remove_index, if you use remove_column it does remove the index but you can't run rake db:rollback. As Jim mentioned.

    remove_column is only reversible if given a type.
    

提交回复
热议问题