We have django-simple-history
for our models. Recently, a whole bunch of models have been mysteriously removed. This was noticed a few days after the fact, so it would be nice to avoid completely restoring the database backup, as this will destroy the manual changes that occurred after the fact.
I can not find a way to easily recover a model instance, in particular, deleted. I can request a historical version of the model and find everything that has been deleted. With this, I can also notice that all of them had exceptions as their last change. I can use the instance property in history - 1 to get the state before deleting, but if I try to save it, since the model instance was deleted and no longer exists.
Basically, what is the cleanest way to recover an instance of a deleted model if I have a historical record with django-simple-history? I would like to keep the story, if possible, so I consider any solution before completely re-creating the objects.
source share