HTTPS clone URL
Subversion checkout URL
Please sign in to comment.
Fixed #22397 -- Issues removing M2M field with explicit through model
Changed the migration autodetector to remove models last so that FK and M2M fields will not be left as dangling references. Added a check in the migration state renderer to error out in the presence of dangling references instead of leaving them as strings. Fixed a bug in the sqlite backend to handle the deletion of M2M fields with "through" models properly (i.e., do nothing successfully). Thanks to melinath for report, loic for tests and andrewgodwin and charettes for assistance with architecture.
- Loading branch information...
Showing with 169 additions and 27 deletions.
- +8 −4 django/db/backends/sqlite3/schema.py
- +10 −10 django/db/migrations/autodetector.py
- +1 −1 django/db/migrations/migration.py
- +10 −0 django/db/migrations/state.py
- +54 −3 tests/migrations/test_autodetector.py
- +45 −9 tests/migrations/test_operations.py
- +41 −0 tests/migrations/test_state.py