I did this which solved the issue for me.
ActiveRecord::Base.connection.tables.each do |t|
ActiveRecord::Base.connection.reset_pk_sequence!(t)
end
I found the reset_pk_sequence! from this thread. http://www.ruby-forum.com/topic/64428
More Related Contents:
- Ignoring time zones altogether in Rails and PostgreSQL
- Can’t find the ‘libpq-fe.h header when trying to install pg gem
- Can’t find the PostgreSQL client library (libpq)
- Repairing Postgresql after upgrading to OSX 10.7 Lion
- PG::Error: SELECT DISTINCT, ORDER BY expressions must appear in select list
- Installing Postgres on windows for use with Ruby-on-Rails
- PGError: ERROR: aggregates not allowed in WHERE clause on a AR query of an object and its has_many objects
- Rails: FATAL – Peer authentication failed for user (PG::Error)
- Adding foreign key to a rails model
- Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432?
- How can I rename a database column in a Ruby on Rails migration?
- How to get a random number in Ruby
- Why do routes with a dot in a parameter fail to match?
- When to use a “has_many :through” relation in Rails?
- rake db:schema:load vs. migrations
- Change from SQLite to PostgreSQL in a fresh Rails project
- ActiveRecord Find By Year, Day or Month on a Date field
- Rails 3: Multiple Select with has_many through associations
- What is the replacement for ActionController::Base.relative_url_root?
- Delete link sends “Get” instead of “Delete” in Rails 3 view
- f.error_messages in Rails 3.0
- Convert UTC to local time in Rails 3
- Scope with join on :has_many :through association
- Rails form_for :remote=>true is not calling js method
- Remote mysql database on Heroku app
- Rails Migrations: tried to change the type of column from string to integer
- How to implement bulk insert in Rails 3
- Sass import error in Rails 3 app – “File to import not found or unreadable: compass”
- How to integrate a Wrap Bootstrap theme into an Rails application?
- Rails 3 SSL routing redirects from https to http