#23048: RemoveField irreversible in certain cases
--------------------------------+----------------------
     Reporter:  harrislapiroff  |      Owner:  nobody
         Type:  Bug             |     Status:  new
    Component:  Migrations      |    Version:  1.7-rc-1
     Severity:  Normal          |   Keywords:
 Triage Stage:  Unreviewed      |  Has patch:  0
Easy pickings:  0               |      UI/UX:  0
--------------------------------+----------------------
 RemoveField is an irreversible operation if a field's original state
 requires it be non-null.

 To reproduce:

 * Write a model with a field with `null=False`
 * Make and run initial migrations.
 * Create and save some instances of your model.
 * Remove the field.
 * Make and run the migration.
 * Attempt to migrate back to the initial migration (i.e., `python
 manage.py migrate myapp 0001`)

 You'll get `django.db.utils.IntegrityError: myapp_mymodel__new.field may
 not be NULL`

 This behavior is documented (https://docs.djangoproject.com/en/dev/ref
 /migration-operations/#django.db.migrations.operations.RemoveField), but I
 believe there should be a way to provide a default value for the field
 when unapplying the migration.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23048>
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/057.7171525fc27b2e1ae284c8b2edfb48c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to