Skip to content

Instantly share code, notes, and snippets.

@dakoctba
Last active August 4, 2016 00:02
Show Gist options
  • Save dakoctba/7d8fcc05315e7025da17ddf82eab540f to your computer and use it in GitHub Desktop.
Save dakoctba/7d8fcc05315e7025da17ddf82eab540f to your computer and use it in GitHub Desktop.

Rails reset ALL Postgres sequences


ActiveRecord::Base.connection.tables.each do |t|
    ActiveRecord::Base.connection.reset_pk_sequence!(t)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment