In my migration I have:
def up MyModel.destroy_all MyModel.create!({:id=>1,:name=>\'foo\'}) MyModel.create!({:id=>2,:name=>\'fooBar\'}) M
If you are using PostgreSQL you can simply do:
ModelName.connection.execute('ALTER SEQUENCE model_name_id_seq RESTART WITH 1')
For example, resetting the auto increment field for the User model would look like:
User.connection.execute('ALTER SEQUENCE users_id_seq RESTART WITH 1')