Loading django/db/backends/mysql/validation.py +14 −16 Original line number Diff line number Diff line Loading @@ -12,15 +12,13 @@ class DatabaseValidation(BaseDatabaseValidation): from django.db import connection errors = super(DatabaseValidation, self).check_field(field, **kwargs) try: # Ignore any related fields. if getattr(field, 'rel', None) is None: field_type = field.db_type(connection) except AttributeError: # If the field is a relative field and the target model is # missing, then field.rel.to is not a model and doesn't have # `_meta` attribute. field_type = '' if (field_type.startswith('varchar') and field.unique if (field_type.startswith('varchar') # Look for CharFields... and field.unique # ... that are unique and (field.max_length is None or int(field.max_length) > 255)): errors.append( checks.Error( Loading Loading
django/db/backends/mysql/validation.py +14 −16 Original line number Diff line number Diff line Loading @@ -12,15 +12,13 @@ class DatabaseValidation(BaseDatabaseValidation): from django.db import connection errors = super(DatabaseValidation, self).check_field(field, **kwargs) try: # Ignore any related fields. if getattr(field, 'rel', None) is None: field_type = field.db_type(connection) except AttributeError: # If the field is a relative field and the target model is # missing, then field.rel.to is not a model and doesn't have # `_meta` attribute. field_type = '' if (field_type.startswith('varchar') and field.unique if (field_type.startswith('varchar') # Look for CharFields... and field.unique # ... that are unique and (field.max_length is None or int(field.max_length) > 255)): errors.append( checks.Error( Loading