diff options
author | Caio Ariede <caio.ariede@gmail.com> | 2015-08-08 09:44:27 -0300 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-08-15 10:02:08 -0400 |
commit | dad8434d6ff5da10959672726dc9b397296d380b (patch) | |
tree | 035a70f167985e8f79d69d67c1b514604beb2f0b /django/db/backends/postgresql/schema.py | |
parent | 7a40fef17ab7918cbb1ddc3ba080f42b420f7a48 (diff) | |
download | django-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.py | 5 |
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)) |