Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to remove the id column in a subsequent Rails 3 ActiveRecord migration?

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

but is it possible to remove the :id column on an existing table in a subsequent up migration?

like image 345
Steve Wilhelm Avatar asked Dec 21 '22 05:12

Steve Wilhelm


1 Answers

You should be able to remove the column just like any other non-id column:

remove_column :posts, :id
like image 145
Peter Brown Avatar answered May 14 '23 07:05

Peter Brown