views:

86

answers:

2

I needed an id field in my rails migration that auto-increments from 0 and not 1.Any idea? Thanks & Cheers !

A: 

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.

Salil
Could you please paste the SQL query here?
Shreyas Satish
A: 

Modify your db/migrate-file:

create_table :table_name, :options => "auto_increment = 0" do |t|
  ...
end
Dennis