Fixed #31630 -- Replaced introspection features with DatabaseFeatures.introspected_field_types.

This commit is contained in:
Hasan Ramezani 2020-05-27 00:25:45 +02:00 committed by Mariusz Felisiak
parent 55556e51fb
commit e198beadad
9 changed files with 90 additions and 94 deletions

View file

@ -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
@ -61,6 +58,15 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_deferrable_unique_constraints = True
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