In this migration I have added the statement at the bottom to start user indexes at 1000 in my Postgres DB:
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.string :password_digest
t.timestamps
end
execute "SELECT setval('users_id_seq', 1000);" # <---- This right here
end
end
Nothing seems to happen. (I have run rake db:reset
more than once, nothing seems to work).
This DOES work from the DB console when executed through the command line though. What am I doing wrong?