#31255: Migrations create a redundant RemoveField operation when deleting 2
models
with related fields.
-------------------------------------+-------------------------------------
Reporter: Panagis | Owner: Rohit Jha
Alisandratos |
Type: | Status: assigned
Cleanup/optimization |
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: migration,optimizer | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sanskar Jaiswal):
Upon doing some more debugging, I found some peculiar behaviour. I tried
to print `generated_operations` at the end of the function
`generate_deleted_models's `. This is the output: `{'some':
[<RemoveField model_name='book', name='authors_book'>, <DeleteModel
name='Book'>, <RemoveField model_name='pub', name='authors_pub'>,
<DeleteModel name='Pub'>]}`.
The method is adding four operations to the `generated_operations`, but
only three of them show up in the actual migrations file. Am I missing
something here?
--
Ticket URL: <https://code.djangoproject.com/ticket/31255#comment:7>
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/066.85cc6a764ab20db417e4abe707aac9ce%40djangoproject.com.