#28542: migration that introduces uuid field is not reversible with unique=True
----------------------------+--------------------------------------
     Reporter:  karyon      |                    Owner:  Tim Martin
         Type:  Bug         |                   Status:  assigned
    Component:  Migrations  |                  Version:  1.11
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Accepted
    Has patch:  0           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+--------------------------------------

Comment (by Tim Martin):

 I've got a theory about this now. When a primary key constraint is removed
 and the target field state is unique, then the primary key constraint is
 deleted along with all other unique constraints on the field. This happens
 in `BaseDatabaseSchemaEditor._alterField`, in the second conditional
 block. But I think this masks the fact that the primary key isn't
 explicitly removed. If the removal isn't triggered by the removal of
 uniqueness, then it doesn't happen.

 I've created a branch with a UT that reproduces this case
 [https://github.com/timmartin/django/tree/ticket_28542 here]

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28542#comment:6>
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/064.497b277694195e3a0830e8bce6a187f5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to