Auto-incrementing from 0 in Rails migrations
I needed an id field in my ra开发者_C百科ils migration that auto-increments from 0 and not 1.Any idea? Thanks & Cheers !
I found it in mysql Advance option "The initial AUTO_INCREMENT" value for the Table. you can set there but i don't know whether you can set that using Rails Migration or not.
Modify your db/migrate-file:
create_table :table_name, :options => "auto_increment = 0" do |t|
...
end
精彩评论