3
在Rails 3中ActiveRecord create_table可以包含選項:id => false。例如有沒有辦法在隨後的Rails 3 ActiveRecord遷移中刪除id列?
create_table :posts, :id => false do |t|
...
end
但有可能刪除後續上遷移現有表上的id列:
在Rails 3中ActiveRecord create_table可以包含選項:id => false。例如有沒有辦法在隨後的Rails 3 ActiveRecord遷移中刪除id列?
create_table :posts, :id => false do |t|
...
end
但有可能刪除後續上遷移現有表上的id列:
您應該能夠刪除列,就像任何其他的非ID列:
remove_column :posts, :id