In my migration I have:
def up
MyModel.destroy_all
MyModel.create!({:id=>1,:name=>\'foo\'})
MyModel.create!({:id=>2,:name=>\'fooBar\'})
M
In case anyone else wonders how to do this with MYSQL: here is the code one would use in the migration in order to reset the auto increment for a table:
ActiveRecord::Base.connection.execute('ALTER TABLE foo_bars AUTO_INCREMENT = 1')
foo_bars
would be the table name whose auto_increment you are resetting.I figured this out thanks to the answer for this question.