mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
[1.7.x] Fixed #22514 -- Prevented indexes on virtual fields [postgres].
Backport of 78c32f1caa from master
This commit is contained in:
committed by
Tim Graham
parent
d9a83d597e
commit
6e5a736752
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user