diff options
Diffstat (limited to 'django/db/backends/postgresql/introspection.py')
-rw-r--r-- | django/db/backends/postgresql/introspection.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py index 1e987d1779..f060546a53 100644 --- a/django/db/backends/postgresql/introspection.py +++ b/django/db/backends/postgresql/introspection.py @@ -1,10 +1,7 @@ -import warnings - from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.db.models.indexes import Index -from django.utils.deprecation import RemovedInDjango21Warning class DatabaseIntrospection(BaseDatabaseIntrospection): @@ -138,31 +135,6 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): key_columns.extend(cursor.fetchall()) return key_columns - def get_indexes(self, cursor, table_name): - warnings.warn( - "get_indexes() is deprecated in favor of get_constraints().", - RemovedInDjango21Warning, stacklevel=2 - ) - # This query retrieves each index on the given table, including the - # first associated field name - cursor.execute(self._get_indexes_query, [table_name]) - indexes = {} - for row in cursor.fetchall(): - # row[1] (idx.indkey) is stored in the DB as an array. It comes out as - # a string of space-separated integers. This designates the field - # indexes (1-based) of the fields that have indexes on the table. - # Here, we skip any indexes across multiple fields. - if ' ' in row[1]: - continue - if row[0] not in indexes: - indexes[row[0]] = {'primary_key': False, 'unique': False} - # It's possible to have the unique and PK constraints in separate indexes. - if row[3]: - indexes[row[0]]['primary_key'] = True - if row[2]: - indexes[row[0]]['unique'] = True - return indexes - def get_constraints(self, cursor, table_name): """ Retrieve any constraints or keys (unique, pk, fk, check, index) across |