Filter events by user or other context value? #223
-
The (more context on this issue: my application has models that belong to an organization. The organization field is usually set on aggregate roots, so it’s not directly set on every model tracked by django-pghistory and so doesn’t end up in the event models. I thought about adding the organization id to the context, but I’m afraid the performance will be bad when showing the aggregated history if it’s not indexed) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
One method is to write a custom migration that adds an index just to the "user" key of the "metadata" in the JSON field:
|
Beta Was this translation helpful? Give feedback.
One method is to write a custom migration that adds an index just to the "user" key of the "metadata" in the JSON field: