1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #30661 -- Added models.SmallAutoField.

This commit is contained in:
Nick Pope
2019-07-26 22:05:22 +01:00
committed by Mariusz Felisiak
parent 955b382600
commit 194d1dfc18
28 changed files with 177 additions and 26 deletions

View File

@@ -57,9 +57,9 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_field_type(self, data_type, description):
field_type = super().get_field_type(data_type, description)
if description.pk and field_type in {'BigIntegerField', 'IntegerField'}:
# No support for BigAutoField as SQLite treats all integer primary
# keys as signed 64-bit integers.
if description.pk and field_type in {'BigIntegerField', 'IntegerField', 'SmallIntegerField'}:
# No support for BigAutoField or SmallAutoField as SQLite treats
# all integer primary keys as signed 64-bit integers.
return 'AutoField'
return field_type