Skip to content

Instantly share code, notes, and snippets.

@jrnk
Created May 25, 2014 11:41
Show Gist options
  • Save jrnk/201d5f231088dc8f00ef to your computer and use it in GitHub Desktop.
Save jrnk/201d5f231088dc8f00ef to your computer and use it in GitHub Desktop.
Reset primary key sequence after database import on all tables (*sql > postgres)
ActiveRecord::Base.connection.tables.each do |table|
ActiveRecord::Base.connection.reset_pk_sequence!(table)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment