#35469: Squashing migrations from unique=True to unique=False to 
UniqueConstraint
produces irreversible migration on Postgres
-----------------------------+------------------------------------
     Reporter:  Jacob Walls  |                    Owner:  nobody
         Type:  Bug          |                   Status:  new
    Component:  Migrations   |                  Version:  4.2
     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 Jacob Walls):

 Thanks for the link to #28646. It's related, but most of the discussion
 there centers around the "boolean logic" cited in that ticket's OP. I
 tried the various patches, and they don't fix my report because they just
 shuffle the logic fathoming the booleans `db_index` and `unique` on
 `old_field` and `new_fields`, whereas the problem here seems to be that
 one of those values is wrong.

 #26805 inspired me to check SlugField. I can't reproduce with SlugField,
 leading me to wonder if it's something to do with `URLField`'s different
 implementation of `deconstruct()`?

 When using SlugField, and breaking on the comment "Added an index? ..." in
 db/backends/postgresql/schema.py, I get:
 {{{
 (Pdb) new_field.db_index
 True
 }}}
 versus with URLField:
 {{{
 (Pdb) new_field.db_index
 False
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35469#comment:4>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018fa02a4273-b1425df9-b7c9-42ea-983a-ff27174b6c5a-000000%40eu-central-1.amazonses.com.

Reply via email to