mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #22514 -- Prevented indexes on virtual fields [postgres].
This commit is contained in:
parent
9a46836a0c
commit
78c32f1caa
3 changed files with 34 additions and 2 deletions
|
@ -29,3 +29,10 @@ class IndexesTests(TestCase):
|
|||
# unique=True and db_index=True should only create the varchar-specific
|
||||
# index (#19441).
|
||||
self.assertIn('("slug" varchar_pattern_ops)', index_sql[4])
|
||||
|
||||
@skipUnless(connection.vendor == 'postgresql',
|
||||
"This is a postgresql-specific issue")
|
||||
def test_postgresql_virtual_relation_indexes(self):
|
||||
"""Test indexes are not created for related objects"""
|
||||
index_sql = connection.creation.sql_indexes_for_model(Article, no_style())
|
||||
self.assertEqual(len(index_sql), 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue