Closed grantjenks closed 8 years ago
Good question. Most migrations should be handled just fine. The only migration that may cause issues is changing the name of a field that you track with django-field-history. That would mean that:
FieldHistoryTracker
, i.e. field_history = FieldHistoryTracker(['new_field_name'])
.FieldHistory
row would need its field_name
attribute changed to the new field name. This is definitely the bigger issue of the two. I could probably provide a management command to update FieldHistory.field_name
based on the FieldHistory.content_type
.Fixed in 2afca6a9ba. I added a management command to update FieldHistory
objects after a field name is changed.
I like your approach to recording model history. I've tried using django-reversion before but it broke as I migrated my models by adding or deleting fields. I wonder, have you considered how django-field-history would handle migrations?