Skip to content

Commit 5bd8687

Browse files
partimerRoss Mechanic
authored andcommitted
BigAutoField not mirrored as bigint in historical copy of table #556 (#560)
* Update models.py BigAutoField not mirrored as bigint in historical copy of table #556 * noting issue in changelog * expects 2 line breaks before class definition * blank line 552 may not contain spaces
1 parent ff08965 commit 5bd8687

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changes
22
=======
33

4+
Unreleased
5+
----------
6+
- Fixed BigAutoField not mirrored as BigInt (gh-556)
47
- Fixed most_recent() bug with excluded_fields (gh-561)
58

69

simple_history/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,9 @@ def get_history_user(self, instance):
528528
def transform_field(field):
529529
"""Customize field appropriately for use in historical model"""
530530
field.name = field.attname
531-
if isinstance(field, models.AutoField):
531+
if isinstance(field, models.BigAutoField):
532+
field.__class__ = models.BigIntegerField
533+
elif isinstance(field, models.AutoField):
532534
field.__class__ = models.IntegerField
533535

534536
elif isinstance(field, models.FileField):

0 commit comments

Comments
 (0)