#24630: UUIDField migration
-------------------------------------+-------------------------------------
     Reporter:  lucacorti            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Migrations           |                  Version:  1.8
     Severity:  Normal               |               Resolution:
     Keywords:  uuidfiled            |             Triage Stage:
  migrations                         |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by KevinEtienne):

 I've run into what I believe the same issue with Django 1.7.x. I have a
 model where I wanted to add and remove a new field.

 The migration had 3 operations:
 * add a new field
 * migrate the data
 * and remove the old field.

 {{{
 ...
     operations = [
         migrations.AddField(
             model_name='model',
             name='new_field',
             field=models.BooleanField(default=False),
             preserve_default=True,
         ),
         migrations.RunPython(
             populate_new_field,
             populate_old_field,
         ),
         migrations.RemoveField(
             model_name='model',
             name='old_field',
         ),
     ]
 }}}

 The stacktrace looks exactly the same as quote in the original
 description. Not sure if this is a behavior expected from Django or not.
 [https://docs.djangoproject.com/en/1.8/ref/migration-operations/#runpython
 The documentation on 1.7] and 1.8 states that `RunPython` should run into
 its own transaction.

--
Ticket URL: <https://code.djangoproject.com/ticket/24630#comment:2>
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/067.7c3bfe2a35c52f57f7886cf4b377fd1d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to