I have a project hosted on Heroku and would like to change a table's autoincrement start value. I'm using SQLite3 locally and Heroku uses PostgreSQL This is what I have in the migration:
class CreateMytable < ActiveRecord::Migration
def self.up
create_table :mytable do |t|
t.text :mytext
end
case ActiveRecord::Base.connection.adapter_name
when 'PostgreSQL'
execute 'ALTER SEQUENCE mytable_id_seq RESTART WITH 1000;'
when 'SQLite'
execute 'update sqlite_sequence set seq = 1000 where name = "mytable";'
else
end
end
def self.down
drop_table :mytable
end
end
Locally the migration runs but SQLite seems to just ignore the change, it works on Heroku though. What am I doing wrong?