summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/schema.py
diff options
context:
space:
mode:
authorCaio Ariede <caio.ariede@gmail.com>2015-08-08 09:44:27 -0300
committerTim Graham <timograham@gmail.com>2015-08-15 10:02:08 -0400
commitdad8434d6ff5da10959672726dc9b397296d380b (patch)
tree035a70f167985e8f79d69d67c1b514604beb2f0b /django/db/backends/postgresql/schema.py
parent7a40fef17ab7918cbb1ddc3ba080f42b420f7a48 (diff)
downloaddjango-dad8434d6ff5da10959672726dc9b397296d380b.tar.gz
Fixed #25180 -- Prevented varchar_patterns_ops and text_patterns_ops indexes for ArrayField.
Diffstat (limited to 'django/db/backends/postgresql/schema.py')
-rw-r--r--django/db/backends/postgresql/schema.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/schema.py b/django/db/backends/postgresql/schema.py
index bc03a12e8d..f34d03ff8c 100644
--- a/django/db/backends/postgresql/schema.py
+++ b/django/db/backends/postgresql/schema.py
@@ -29,6 +29,11 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# a second index that specifies their operator class, which is
# needed when performing correct LIKE queries outside the
# C locale. See #12234.
+ #
+ # The same doesn't apply to array fields such as varchar[size]
+ # and text[size], so skip them.
+ if '[' in db_type:
+ continue
if db_type.startswith('varchar'):
output.append(self._create_index_sql(
model, [field], suffix='_like', sql=self.sql_create_varchar_index))