#33108: Makemigrations allows on-off default when adding non-nullable unique 
field
-------------------------------------+-------------------------------------
     Reporter:  Julian-Samuel        |                    Owner:  nobody
  Gebühr                             |
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Migrations           |                  Version:  3.2
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  migrations           |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * type:  Bug => Cleanup/optimization
 * resolution:   => wontfix


Comment:

 Thanks for the report.

 > ... and fail to make the migration.

 This is not an expected behavior, because you can add a column to an empty
 table or a table with a single row. In both cases it works fine. Moreover
 we already inform users that provided value ''"...will be set on all
 existing rows with a null value for this column"''. Also, it's
 [https://docs.djangoproject.com/en/stable/howto/writing-migrations
 /#migrations-that-add-unique-fields documented] in details how to deal
 with such migration.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33108#comment:1>
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/064.0cd2502ddddd39965662751297ee43c7%40djangoproject.com.

Reply via email to