我已经运行了这个迁移:
class AddUniqueToLocationColumnName < ActiveRecord::Migration
def change
remove_index :locations, :name
add_index :locations, :name, unique: true
end
end
现在我正在尝试回滚,但是显示错误:
标准错误:发生错误,此及后续所有迁移均已取消:remove_index只有在给定:column选项时才可逆转。
我如何将此迁移回滚到之前的版本?
remove_index :locations, column: :name
。 (将 "try" 翻译为 "尝试","changing" 翻译为 "更改","it" 指代的是前文提到的某个代码或指令,"remove_index" 保持原文不变,":locations" 指代某个表格名称,"column" 翻译为 "列",":name" 指代该表格中的某个列名。) - max