def transform_field(field):
    field.name = field.attname
    if isinstance(field, models.AutoField):
        field.__class__ = convert_auto_field(field)

    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
Returns a token or None if no new tokens can be found.
dataset/ETHPy150Open treyhunner/django-simple-history/simple_history/models.py/transform_field--crossover with--dataset/ETHPy150Open zoofIO/flexx/translate_to_legacy.py/BaseTranslator._find_next_token