Skip to content

Instantly share code, notes, and snippets.

@brainwire
Created December 22, 2014 09:54
Show Gist options
  • Select an option

  • Save brainwire/8a73d0174be0f1409fda to your computer and use it in GitHub Desktop.

Select an option

Save brainwire/8a73d0174be0f1409fda to your computer and use it in GitHub Desktop.
Rails auto-assigning id that already exists
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