mirror of
https://github.com/django/django.git
synced 2025-08-27 14:04:41 +00:00
Fixed #27098 -- Deprecated DatabaseIntrospection.get_indexes
Thanks Akshesh <aksheshdoshi@gmail.com> for help with the PostgreSQL query. Thanks Tim Graham for the review.
This commit is contained in:
parent
1ec1633cb2
commit
d389125606
13 changed files with 81 additions and 29 deletions
|
@ -483,9 +483,13 @@ class TestMigrations(TransactionTestCase):
|
|||
]
|
||||
# Only the CharField should have a LIKE index.
|
||||
self.assertEqual(like_constraint_columns_list, [['char2']])
|
||||
with connection.cursor() as cursor:
|
||||
indexes = connection.introspection.get_indexes(cursor, table_name)
|
||||
# All fields should have regular indexes.
|
||||
with connection.cursor() as cursor:
|
||||
indexes = [
|
||||
c['columns'][0]
|
||||
for c in connection.introspection.get_constraints(cursor, table_name).values()
|
||||
if c['index'] and len(c['columns']) == 1
|
||||
]
|
||||
self.assertIn('char', indexes)
|
||||
self.assertIn('char2', indexes)
|
||||
self.assertIn('text', indexes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue