diff options
| author | Tim Graham <timograham@gmail.com> | 2020-06-01 20:18:14 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-06-04 08:27:46 +0200 |
| commit | e24b63fe859c03c429ebeb7d28665f591cee22ff (patch) | |
| tree | a6749884b93c01aa0c4e311535bded8d35dbba04 /django | |
| parent | e198beadad56d5fdd06756b097446b7046a84010 (diff) | |
Refs #31630 -- Removed DatabaseFeatures.can_introspect_autofield.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/inspectdb.py | 2 | ||||
| -rw-r--r-- | django/db/backends/base/features.py | 4 | ||||
| -rw-r--r-- | django/db/backends/mysql/features.py | 1 | ||||
| -rw-r--r-- | django/db/backends/oracle/features.py | 1 | ||||
| -rw-r--r-- | django/db/backends/sqlite3/features.py | 1 |
5 files changed, 2 insertions, 7 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py index 70bc5baee3..73e8a19e76 100644 --- a/django/core/management/commands/inspectdb.py +++ b/django/core/management/commands/inspectdb.py @@ -142,7 +142,7 @@ class Command(BaseCommand): if att_name == 'id' and extra_params == {'primary_key': True}: if field_type == 'AutoField(': continue - elif field_type == 'IntegerField(' and not connection.features.can_introspect_autofield: + elif field_type == connection.features.introspected_field_types['AutoField'] + '(': comment_notes.append('AutoField?') # Add 'null' and 'blank', if the 'null_ok' flag was present in the diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py index 533dbc7fec..10bd4077dc 100644 --- a/django/db/backends/base/features.py +++ b/django/db/backends/base/features.py @@ -125,12 +125,10 @@ class BaseDatabaseFeatures: # which can't do it for MyISAM tables can_introspect_foreign_keys = True - # Can the backend introspect an AutoField, instead of an IntegerField? - can_introspect_autofield = False - # Map fields which some backends may not be able to differentiate to the # field it's introspected as. introspected_field_types = { + 'AutoField': 'AutoField', 'BigAutoField': 'BigAutoField', 'BigIntegerField': 'BigIntegerField', 'BinaryField': 'BinaryField', diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py index a1a6e4b084..85017012b1 100644 --- a/django/db/backends/mysql/features.py +++ b/django/db/backends/mysql/features.py @@ -14,7 +14,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_forward_references = False supports_regex_backreferencing = False supports_date_lookup_using_string = False - can_introspect_autofield = True supports_index_column_ordering = False supports_timezones = False requires_explicit_null_ordering_when_grouping = True diff --git a/django/db/backends/oracle/features.py b/django/db/backends/oracle/features.py index 66dfdd4399..c497a7c0b6 100644 --- a/django/db/backends/oracle/features.py +++ b/django/db/backends/oracle/features.py @@ -11,7 +11,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): has_select_for_update_of = True select_for_update_of_column = True can_return_columns_from_insert = True - can_introspect_autofield = True supports_subqueries_in_group_by = False supports_transactions = True supports_timezones = False diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py index 08c8eb70b9..84358838db 100644 --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/features.py @@ -18,7 +18,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_timezones = False max_query_params = 999 supports_mixed_date_datetime_comparisons = False - can_introspect_autofield = True supports_transactions = True atomic_transactions = False can_rollback_ddl = True |
