Replies: 1 comment 9 replies
-
|
I recently found myself wishing I had the diff directly in a JSON in the history model. We have some fields in the auto-generated history models that are opt-in. I'd certainly be open to supporting this as part of pghistory. are you using NEW/OLD to compute the diff in a trigger? Any issues you ran into? From the perspective of the library, I assume it would only store the diff of the fields you're tracking. I could see the alternative use case though |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In our usecase, where the number of events are in the order of millions, and we actually use some keys in the pgh_diff to filter querysets, we couldn't use the generated pgh_diff column in the CTE. We added triggers to persist it in database as a jsonfield and overrode the Events model to use the persisted column instead.
If you're interested, I can share what we did and we can discuss how can it be included in the project here.
Beta Was this translation helpful? Give feedback.
All reactions