You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's what happening here (a note to everyone who would like to pick this issue while I'm enjoying New Year holidays 🎄):
We use hstore_to_jsonb_loose to efficiently calculate diffs between two JSONB objects—that happens only on UPDATE.
Initial snapshot doesn't use hstore, thus, we store JSONB as as.
To fix this we need to ensure that snapshots also stringify values.
P.S. @edymerchk except from the format difference, does it cause any issues? I guess, we handle this at the Ruby side correctly, i.e., both strings and Hashes are deserialized into Hashes.
Tell us about your environment
Ruby Version: 2.6.3p62
Rails Version: 6.0.3
PostgreSQL Version: 11.8
Logidze Version: 1.0.0
What did you do?
Tried to use logidze tracking a JSONB column
I have a table like:
and a trigger (generated by gem) like:
What did you expect to happen?
Store always the
changes
in the same formatWhat actually happened?
First change is stored as JSON, but subsequent are Stringify
BTW! Thank you for this amazing gem!
The text was updated successfully, but these errors were encountered: