#25412: Migrate command does not create index with operator class for CharField
-------------------------------+--------------------
     Reporter:  synasius       |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Migrations     |    Version:  1.8
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 `./manage.py migrate` command does not create an additional index with the
 operator class for a CharField, when `db_index=True` is added to an
 existing field.

 I created a sample project to reproduce the error here:
 https://github.com/synasius/foo

 There are two models, `Person` and `Car`.
 `Person`'s "name" field was migrated with `db_index=True` and if I run
 `./manage.py sqlmigrate bar 0001` I can see both the indexes, one using
 the operator class `varchar_pattern_ops`.

 The issue occurs when `db_index=True` is added to `Car`'s name field and
 then a migration is created. When I run `./manage.py sqlmigrate bar 0002`
 I can only see one plain index.

 I reproduced the issue in Django 1.7.x, 1.8.x and master. I'm using
 postgresql 9.4.4.

--
Ticket URL: <https://code.djangoproject.com/ticket/25412>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.e42f951dd421d2de0176351214c47a53%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to