mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +00:00
Refs #27030 -- Added index type introspection on PostgreSQL.
This commit is contained in:
parent
72d541b61c
commit
2f19306a12
5 changed files with 21 additions and 6 deletions
|
|
@ -170,6 +170,11 @@ class IntrospectionTests(TransactionTestCase):
|
|||
def test_get_indexes(self):
|
||||
with connection.cursor() as cursor:
|
||||
indexes = connection.introspection.get_indexes(cursor, Article._meta.db_table)
|
||||
if connection.features.can_introspect_index_type:
|
||||
index_type = indexes['reporter_id'].pop('type', None)
|
||||
self.assertIsNotNone(index_type)
|
||||
if connection.vendor == 'postgresql':
|
||||
self.assertEqual(index_type, 'btree')
|
||||
self.assertEqual(indexes['reporter_id'], {'unique': False, 'primary_key': False})
|
||||
|
||||
def test_get_indexes_multicol(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue