code: def transform_field(field):
      
      field.name = field.attname
      if isinstance(field, models.AutoField):
          field.__class__ = models.IntegerField
  
      elif isinstance(field, models.FileField):
          # Don't copy file, just path.
          field.__class__ = models.TextField
  
      # Historical instance shouldn't change create/update timestamps
      field.auto_now = False
      field.auto_now_add = False
  
      if field.primary_key or field.unique:
          # Unique fields can no longer be guaranteed unique,
          # but they should still be indexed for faster lookups.
          field.primary_key = False
          field._unique = False
          field.db_index = True
          field.serialize = True
docs: Customize field appropriately for use in historical model