Skip to content

Instantly share code, notes, and snippets.

@luxxi
Created March 17, 2017 10:04
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 luxxi/82886c29cf8116a92dcdb1eeca6786ee to your computer and use it in GitHub Desktop.
Save luxxi/82886c29cf8116a92dcdb1eeca6786ee to your computer and use it in GitHub Desktop.
Reset primary key sequence in postgres
ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.reset_pk_sequence!(t) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment