Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #19709 -- Fixed TimeField introspection on MySQL

Thanks Eugene Grachev for the report.
  • Loading branch information...
commit 3c0a81aaf0a4ba675f80d50c788aea706d0c812c 1 parent eb03fe1
Claude Paroz claudep authored
1  django/db/backends/mysql/introspection.py
View
@@ -21,6 +21,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
FIELD_TYPE.LONGLONG: 'BigIntegerField',
FIELD_TYPE.SHORT: 'IntegerField',
FIELD_TYPE.STRING: 'CharField',
+ FIELD_TYPE.TIME: 'TimeField',
FIELD_TYPE.TIMESTAMP: 'DateTimeField',
FIELD_TYPE.TINY: 'IntegerField',
FIELD_TYPE.TINY_BLOB: 'TextField',
6 tests/regressiontests/inspectdb/tests.py
View
@@ -87,11 +87,7 @@ def assertFieldType(name, definition):
else:
assertFieldType('field19', "models.IntegerField()")
assertFieldType('field20', "models.TextField()")
- if connection.vendor == 'mysql':
- # Ticket #19709
- assertFieldType('field21', "models.TextField() # This field type is a guess.")
- else:
- assertFieldType('field21', "models.TimeField()")
+ assertFieldType('field21', "models.TimeField()")
# URLField
assertFieldType('field22', "models.CharField(max_length=200)")
Please sign in to comment.
Something went wrong with that request. Please try again.