2

I have an app that was recently upgraded to Rails 4.2.0 and Ruby 2.2.0. Since the upgrade I am seeing the following exception in the production environment:

Mysql2::Error: Field 'item_type' doesn't have a default value: INSERT INTO versions VALUES ()

This doesn't seem to occur consistently. I only know this exists because of ExceptionNotification emails where this occurred with other users. I made several attempts to recreate the issue, but it never happens for me despite executing the same code where this occurred.

Also I want to mention that in all of the models that call has_paper_trail I am passing no options, so there are no limitations on what attributes are tracked. It seems like if a version was being inserted it should always have some kind of change.

This never happened until we upgraded from Rails 3.2.11 and Ruby 1.9.3 to Rails 4.2.0 and Ruby 2.2.0.

I just check GitHub and according to the Gemfile.lock it looks like we went from paper_trail 2.7.2 to 3.0.6.

What is causing this to happen and how can it be fixed?

mikewoj
  • 23
  • 4

0 Answers0