【发布时间】:2014-03-30 15:19:37
【问题描述】:
我发现我的架构中有两个“survey_id”列,这给我带来了一些问题。具体来说,我需要删除第二个索引,因为我不希望survey_id 是唯一的。
add_index "completions", ["survey_id"], name: "index_completions_on_survey_id"
add_index "completions", ["survey_id"], name: "index_completions_on_survey_id_and_user_id", unique: true
我试过了
def change
remove_index "completions", ["survey_id"], name => "index_completions_on_survey_id_and_user_id"
end
和
def change
remove_index "completions", ["survey_id"], name: "index_completions_on_survey_id_and_user_id"
end
但这些似乎都不起作用。此迁移删除索引的正确语法是什么?我觉得这是基本的,我只是错过了一些愚蠢的东西。提前致谢!
【问题讨论】:
标签: ruby-on-rails