#26926: Dual index migration bug?
----------------------------+--------------------------------------
     Reporter:  Vaal        |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  1.9
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Unreviewed
    Has patch:  0           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+--------------------------------------
Description changed by Vaal:

Old description:

> Example:
>
> 1) Added new field to model
> x_index = models.BooleanField(default=True, db_index=True, unique=True)
> There is an unnecessary index. But the conditions of the situation.
>
> 2) Create and run the migration.
> In the database this field will have only one index - unique.
>
> 3) Change the field.
> x_index = models.BooleanField(default=True, db_index=True)
> Remove the unique index.
>
> 4) Create and run the migration.
> Now, this field doesn't have of any indexes in database.

New description:

 Example:

 1) Added new field to model
 x_index = models.BooleanField(default=True, db_index=True, unique=True)
 There is an unnecessary index. But the conditions of the situation.

 2) Create and run the migration.
 In the database this field will have only one index - unique.

 3) Change the field.
 x_index = models.BooleanField(default=True, db_index=True)
 Remove the unique index.

 4) Create and run the migration.
 Now, this field doesn't have of any indexes in database.

 p.s. Mysql database

--

--
Ticket URL: <https://code.djangoproject.com/ticket/26926#comment:3>
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/062.b4af6e0543e6e42855698cc76ce28c38%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to