Skip to content

Instantly share code, notes, and snippets.

@strotter
Created April 1, 2014 16:25
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 strotter/9917655 to your computer and use it in GitHub Desktop.
Save strotter/9917655 to your computer and use it in GitHub Desktop.
Update postgresql sequences in Rails for all tables.
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