Skip to content

Commit 6aee54b

Browse files
committed
mark get_indexes as deprecated
1 parent 1545bb0 commit 6aee54b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sql_server/pyodbc/introspection.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import warnings
2+
13
import pyodbc as Database
24

35
from django.db.backends.base.introspection import (
46
BaseDatabaseIntrospection, FieldInfo, TableInfo,
57
)
68
from django.db.models.indexes import Index
9+
from django.utils.deprecation import RemovedInDjango21Warning
710

811
SQL_AUTOFIELD = -777555
912
SQL_BIGAUTOFIELD = -777444
@@ -144,6 +147,10 @@ def get_indexes(self, cursor, table_name):
144147
145148
Only single-column indexes are introspected.
146149
"""
150+
warnings.warn(
151+
"get_indexes() is deprecated in favor of get_constraints().",
152+
RemovedInDjango21Warning, stacklevel=2
153+
)
147154
# CONSTRAINT_COLUMN_USAGE: http://msdn2.microsoft.com/en-us/library/ms174431.aspx
148155
# TABLE_CONSTRAINTS: http://msdn2.microsoft.com/en-us/library/ms181757.aspx
149156

0 commit comments

Comments
 (0)