Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't appear to be working with PaperTrail Gem. #7

Open
joshuapinter opened this issue Jan 23, 2019 · 0 comments
Open

Doesn't appear to be working with PaperTrail Gem. #7

joshuapinter opened this issue Jan 23, 2019 · 0 comments

Comments

@joshuapinter
Copy link

When restarting transactions after hitting a deadlock, I'm getting this error message:

ActiveRecord::StatementInvalid: Mysql2::Error: Field 'item_type' doesn't have a default value: INSERT INTO `versions` (`item_id`) VALUES (2148253670)

The versions table is used by the PaperTrail Gem to store changes to records. Since versions are polymorphic, it needs to store item_type and item_id, like User and 1234.

My guess is that when this gem retries the transaction, it loses this somewhere along the way.

Note, this is the only time I've encountered this error and it only occurs with the transaction_retry gem and after hitting a deadlock.

I might be able to investigate further but a little help in the right direction would be good.

Thanks!

Josh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant