Depending on how data is imported into the postgres database, the id sequence may not be updated to reflect the newest id which should be inserted. This can cause any attempts to create a new model to return an error as the id is not unique. To fix this, the error should be detected, and the sequence reset for the table.
Depending on how data is imported into the postgres database, the id sequence may not be updated to reflect the newest id which should be inserted. This can cause any attempts to create a new model to return an error as the id is not unique. To fix this, the error should be detected, and the sequence reset for the table.
Relevant link: http://www.osny.me/blog/how-to-reset-postgres-id-sequence-in-a-ruby-on-rails-app