Last active
January 3, 2016 17:59
-
-
Save lauborges/8499057 to your computer and use it in GitHub Desktop.
Fix - postgresql duplicate key violates unique constraint
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.reset_pk_sequence!('entities') | |
ActiveRecord::Base.connection.tables.map do |model| | |
ActiveRecord::Base.connection.reset_pk_sequence!(model.downcase) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment