mirror of
https://github.com/django/django.git
synced 2025-08-06 20:08:20 +00:00
Fixed #31630 -- Replaced introspection features with DatabaseFeatures.introspected_field_types.
This commit is contained in:
parent
55556e51fb
commit
e198beadad
9 changed files with 90 additions and 94 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue