#25521: squashmigrations tries to add foreign keys to removed models
-------------------------------+--------------------
     Reporter:  keturn         |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Migrations     |    Version:  1.8
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 I squashed a bunch of migrations in an app we'll call "foo". There was
 something like this going on:

 * on foo.Foo add ForeignKey to bar.Bar
 * on foo.Foo remove ForeignKey to bar.Bar
 * remove model bar.Bar

 this ended up with a squashed migration with both AddField and RemoveField
 in it, which seems inefficient but might have worked. The problem was
 that, since the target model had been entirely removed in the depended-
 upon state, the AddField to it didn't work at all. (and failed with some
 misleading message in `BaseDatabaseSchemaEditor.add_field` about `unicode
 has no attribute _meta`.)

 This was in Django 1.8.5. Haven't tried other versions.

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

Reply via email to