summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/introspection.py
diff options
context:
space:
mode:
authorAlexander Sosnovskiy <alecs.box@gmail.com>2015-07-02 11:43:15 +0300
committerTim Graham <timograham@gmail.com>2015-12-25 20:01:31 -0500
commit2a7ce34600d0f879e93c9a5e02215948ed3bb6ac (patch)
treed1a4770772b452513e1d64c090dc15ae287afe70 /django/db/backends/postgresql/introspection.py
parenta1d0c60fa05cbad2e5a25ec37e0afaf1b84c9302 (diff)
downloaddjango-2a7ce34600d0f879e93c9a5e02215948ed3bb6ac.tar.gz
Fixed #14286 -- Added models.BigAutoField.
Diffstat (limited to 'django/db/backends/postgresql/introspection.py')
-rw-r--r--django/db/backends/postgresql/introspection.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py
index 9b3e9074b2..90b7090464 100644
--- a/django/db/backends/postgresql/introspection.py
+++ b/django/db/backends/postgresql/introspection.py
@@ -46,8 +46,11 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_field_type(self, data_type, description):
field_type = super(DatabaseIntrospection, self).get_field_type(data_type, description)
- if field_type == 'IntegerField' and description.default and 'nextval' in description.default:
- return 'AutoField'
+ if description.default and 'nextval' in description.default:
+ if field_type == 'IntegerField':
+ return 'AutoField'
+ elif field_type == 'BigIntegerField':
+ return 'BigAutoField'
return field_type
def get_table_list(self, cursor):