Skip to content

Instantly share code, notes, and snippets.

@mrjman
Created July 2, 2014 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrjman/b5189105f9dca76fe90b to your computer and use it in GitHub Desktop.
Save mrjman/b5189105f9dca76fe90b to your computer and use it in GitHub Desktop.
Reset PK sequences in Rails
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