diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2014-08-25 22:22:55 -0700 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2014-08-27 10:58:44 -0400 |
| commit | f0d3dd4f04efa49e0b58da4847cb89770b59d4a8 (patch) | |
| tree | 0c5b6e405ded6ac28b8a420740a8d15f9870b162 /django | |
| parent | a81af7f49de7ff3f51f111de28ed3a682f67ea89 (diff) | |
Fixed #23357 -- Added small int introspection support to MySQL backend.
In the MySQL backend, updated the can_introspect_small_integer feature
flag to True. In data_types_reverse, map FIELD_TYPE.SHORT to a
SmallIntegerField. Added test to verify introspecting SmallIntegerFields
and fixed existing tests influenced by this change.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/mysql/base.py | 1 | ||||
| -rw-r--r-- | django/db/backends/mysql/introspection.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 393af224e4..a7fe9b6104 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -178,6 +178,7 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_date_lookup_using_string = False can_introspect_binary_field = False can_introspect_boolean_field = False + can_introspect_small_integer_field = True supports_timezones = False requires_explicit_null_ordering_when_grouping = True allows_auto_pk_0 = False diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py index 14aea3b475..9b1a9a319b 100644 --- a/django/db/backends/mysql/introspection.py +++ b/django/db/backends/mysql/introspection.py @@ -21,7 +21,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): FIELD_TYPE.INT24: 'IntegerField', FIELD_TYPE.LONG: 'IntegerField', FIELD_TYPE.LONGLONG: 'BigIntegerField', - FIELD_TYPE.SHORT: 'IntegerField', + FIELD_TYPE.SHORT: 'SmallIntegerField', FIELD_TYPE.STRING: 'CharField', FIELD_TYPE.TIME: 'TimeField', FIELD_TYPE.TIMESTAMP: 'DateTimeField', |
