#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 Simon Charette): > 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? Yes. The optimizer is likely able to optimize one of the `RemoveField` into its corresponding `DeleteModel` but not the other one. The reduction operation takes place in `RemoveField.reduce`. See #26720 (https://github.com/django/django/pull/7999) and https://code.djangoproject.com/ticket/24424#comment:35 for more details about that. -- Ticket URL: <https://code.djangoproject.com/ticket/31255#comment:8> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.86e84ba29277542e595ae46de01c6bb4%40djangoproject.com.