#34881: migrate crashes when renaming model referenced twice by
ManyToManyField.through model on SQLite.
----------------------------+----------------------------------------
     Reporter:  dennisvang  |                    Owner:  Jase Hackman
         Type:  Bug         |                   Status:  assigned
    Component:  Migrations  |                  Version:  dev
     Severity:  Normal      |               Resolution:
     Keywords:  sqlite      |             Triage Stage:  Accepted
    Has patch:  0           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+----------------------------------------
Changes (by Jase Hackman):

 * cc: Jase Hackman (added)


Comment:

 I made some progress on this:
 - Created a regression test for the issue
 
[https://github.com/django/django/commit/f3c0557dd81284e5e47bcbc0de3ca94aced13743
 commit link]
 - In the SQLite `DatabaseSchemaEditor` I laid out all the code paths that
 are possible. I still need to implement the one that will be the new
 single table rebuild.
 
[https://github.com/django/django/commit/a694d0a24939611b056b95a2df929d1606a69006
 commit link]
 - I have the beginnings of tests for all the code paths for
 alter_fields(). I'm still working out how to properly assert that I am
 getting the results I want, but I validated that each case is hitting to
 correct conditional via breakpoint.
 
[https://github.com/django/django/commit/2b60f6767f1ae73b9812fee228907934c5349327
 commit link containing current alter_fields code]

 Right now it is looking like I will need to repeat a lot of the logic
 `super().alter_field()` and from `self._alter_field()` to ensure all of
 the validation is consistent. So next I'm going to look into breaking some
 of that out into private method to keep things a bit more dry.

 
[https://github.com/django/django/compare/main...jasehackman:django:ticket_34881
 full set of changes so far]

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34881#comment:16>
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/0107018b4ebc3dd2-62cb1da6-c9b0-45bb-a86f-6362e81c4a38-000000%40eu-central-1.amazonses.com.

Reply via email to