Django [Postgreq] restore single field/column
I have a model with field creation_date = models.DateTimeField(auto_now_add=True)
.
Doing some complex manipulations with migration
file (converting model to multi-table inheritance and creating new objects) I've accidentally overwriten the field above.
I have backups but need to overwrite only the single field creation_date
as there are some fields in table are not align with current state.
I guess there is a way to dump (id, creation_date)
in JSON file and update the corresponding objects with for loop
.
Is there a way to pull data from gzip
backup and save it to .json
? Or some more easier way to go?