Migrating existing data to start capturing history #209
naomicrosthwaite
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I since found issue #94 which I found useful and allowed me to make progress. I would like to understand further why you'd need to reference the model itself and not through the app registry, especially since this is as recommended by the Django docs? 🤔 I also personally would think it would be nice functionality to default create those initial Event objects for any existing data (or at least configurable in case you didn't want it). Or instead update so that the first |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi there 👋
I have an existing model that has existing data that I would like to start tracking history on. I found that by editing an instance for the first time after adding history that the event created didn't capture a diff, so I decide to create dummy "insert" events utilising
create_event()
as part of the migration file generated by adding the@pghistory.track
decorator to the mode.This worked fine locally however when deploying I've got the following error: ""insert" is not a registered tracker label for model MyModel". Am I doing something wrong? The "insert" label is the label of a newly created MyModel object after the history tracking was set up.
Relevant code below:
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions