summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/features.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-05-27 00:25:45 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-04 08:27:42 +0200
commite198beadad56d5fdd06756b097446b7046a84010 (patch)
tree259d188fe8ab2490916419a771163a750b618935 /django/db/backends/postgresql/features.py
parent55556e51fb152c864ddc782d9b56e8b785ccf8bc (diff)
downloaddjango-e198beadad56d5fdd06756b097446b7046a84010.tar.gz
Fixed #31630 -- Replaced introspection features with DatabaseFeatures.introspected_field_types.
Diffstat (limited to 'django/db/backends/postgresql/features.py')
-rw-r--r--django/db/backends/postgresql/features.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py
index f8d2ea1286..f11558c791 100644
--- a/django/db/backends/postgresql/features.py
+++ b/django/db/backends/postgresql/features.py
@@ -22,10 +22,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
can_release_savepoints = True
supports_tablespaces = True
supports_transactions = True
- can_introspect_autofield = True
- can_introspect_ip_address_field = True
can_introspect_materialized_views = True
- can_introspect_small_integer_field = True
can_distinct_on_fields = True
can_rollback_ddl = True
supports_combined_alters = True
@@ -62,6 +59,15 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_json_operators = True
@cached_property
+ def introspected_field_types(self):
+ return {
+ **super().introspected_field_types,
+ 'PositiveBigIntegerField': 'BigIntegerField',
+ 'PositiveIntegerField': 'IntegerField',
+ 'PositiveSmallIntegerField': 'SmallIntegerField',
+ }
+
+ @cached_property
def is_postgresql_10(self):
return self.connection.pg_version >= 100000