Created
July 2, 2014 15:53
-
-
Save mrjman/b5189105f9dca76fe90b to your computer and use it in GitHub Desktop.
Reset PK sequences in Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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