将使用 Rails 迁移删除列删除与列关联的索引 [英] Will removing a column with a Rails migration remove indexes associated with the column

查看:33
本文介绍了将使用 Rails 迁移删除列删除与列关联的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Rails 2 中,删除带有 Rails 迁移的列是否也会更改/删除与该列关联的索引?如果没有,您还必须手动更改/删除每个索引,难道它不应该是自动化的吗?

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 index manually, shouldn't it instead be automated?

谢谢(来自 Rails 新手)

Thanks (from a Rails newbie)

推荐答案

不,不幸的是,您必须使用 remove_index 方法.

No, unfortunately you have to remove the index manually from within your migration using the remove_index method.

这篇关于将使用 Rails 迁移删除列删除与列关联的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆