#28987: Migration changing ManyToManyField target to 'self' doesn't work 
correctly
---------------------------------+------------------------------------
     Reporter:  MSleepyPanda     |                    Owner:  Bhuvnesh
         Type:  Bug              |                   Status:  assigned
    Component:  Migrations       |                  Version:  2.0
     Severity:  Normal           |               Resolution:
     Keywords:  ManyToManyField  |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------

Comment (by Bhuvnesh):

 While altering a many to many field , a new table is created (which is
 later renamed) and data is copied from old table to new table and then old
 table is deleted. This issue caused while making this new table
 
[https://github.com/django/django/blob/main/django/db/backends/sqlite3/schema.py#L496
 here], we are only altering the {{{m2m_reverse_fields}}} ignoring the
 {{{m2m_fields}}} that points to our model.
 Hope i'm proceeding into the right direction.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28987#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/010701844e45b195-3ea7c13d-8ff5-4dca-9bf5-c158daefe8e4-000000%40eu-central-1.amazonses.com.

Reply via email to