views:

76

answers:

1

I have a table already created. I am looking for a rails migration where I can modify the starting point of the auto_increment number for id column of my table. Let's say I want it to start from 1000.

I googled a bit and came across this:

it says:

:options "string" pass raw options to your underlying database, e.g. auto_increment = 10000. Note that passing options will cause you to lose the default ENGINE=InnoDB statement

Can this be used for something I want? and how will the migration look since i am changing the column and not creating new one...

+1  A: 

You can use raw execute method

execute ("ALTER TABLE your_table_name AUTO_INCREMENT = 10000")
Voyta