本文介绍了有没有办法删除ID列在随后的Rails 3的ActiveRecord迁移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Rails 3中ActiveRecord的CREATE_TABLE是有可能包括选项:ID =>假的。例如
In Rails 3 ActiveRecord create_table is it possible to include the option :id => false. For example
create_table :posts, :id => false do |t| ... end
但有可能删除:id列上现有的表在随后的向上迁移?
but is it possible to remove the :id column on an existing table in a subsequent up migration?
推荐答案您应该能够删除该列,就像任何其他的非id列:
You should be able to remove the column just like any other non-id column:
remove_column :posts, :id更多推荐
有没有办法删除ID列在随后的Rails 3的ActiveRecord迁移?
发布评论