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:
committed by
Mariusz Felisiak
parent
955b382600
commit
194d1dfc18
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user