diff options
author | Claude Paroz <claude@2xlibre.net> | 2016-08-20 12:14:02 +0200 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2016-09-12 09:26:33 +0200 |
commit | d389125606152a6cd57d0f6cadeddf0bd6232215 (patch) | |
tree | 20f8b19adbcccf3b274136743efe3c596a86ffe7 /django/db/backends/postgresql/introspection.py | |
parent | 1ec1633cb294d8ce2a65ece6b56c258483596fba (diff) | |
download | django-d389125606152a6cd57d0f6cadeddf0bd6232215.tar.gz |
Fixed #27098 -- Deprecated DatabaseIntrospection.get_indexes
Thanks Akshesh <aksheshdoshi@gmail.com> for help with the PostgreSQL query.
Thanks Tim Graham for the review.
Diffstat (limited to 'django/db/backends/postgresql/introspection.py')
-rw-r--r-- | django/db/backends/postgresql/introspection.py | 6 |
1 files changed, 6 insertions, 0 deletions
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]) |