diff options
| author | Daniel Hahler <git@thequod.de> | 2014-03-20 05:08:28 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-03-24 13:24:52 -0400 |
| commit | 1edfa155e34dde549ef0e93414f2846dce59e5f7 (patch) | |
| tree | 3f07b7527e8bf057454afb9a49dbedbbc1195afe /django/db/backends/sqlite3 | |
| parent | d81a9c50d84d515ddc8ee76ecc5ad5d86e210504 (diff) | |
Fixed #22293 -- Avoided renaming many-to-many tables to themselves.
Fixed this for both implementations of _alter_many_to_many, instead of
in `alter_db_table` itself (more implementations).
Diffstat (limited to 'django/db/backends/sqlite3')
| -rw-r--r-- | django/db/backends/sqlite3/schema.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py index 8c6db9776a..c206a020d5 100644 --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -161,6 +161,9 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): """ Alters M2Ms to repoint their to= endpoints. """ + if old_field.rel.through == new_field.rel.through: + return + # Make a new through table self.create_model(new_field.rel.through) # Copy the data across |
