From d389125606152a6cd57d0f6cadeddf0bd6232215 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 20 Aug 2016 12:14:02 +0200 Subject: Fixed #27098 -- Deprecated DatabaseIntrospection.get_indexes Thanks Akshesh for help with the PostgreSQL query. Thanks Tim Graham for the review. --- django/db/backends/postgresql/introspection.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'django/db/backends/postgresql/introspection.py') diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py index 8a8465d443..29e11499a9 100644 --- a/django/db/backends/postgresql/introspection.py +++ b/django/db/backends/postgresql/introspection.py @@ -1,10 +1,12 @@ from __future__ import unicode_literals +import warnings from collections import namedtuple from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) +from django.utils.deprecation import RemovedInDjango21Warning from django.utils.encoding import force_text FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',)) @@ -124,6 +126,10 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): 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]) -- cgit v1.2.1