mirror of
https://github.com/django/django.git
synced 2025-08-30 15:27:40 +00:00
Fixed #28862 -- Disabled optimization of AlterFooTogether and RemoveField.
AlterFooTogether operations cannot be swapped with RemoveField operations on the same model as they could be removing the the same field as well. Since AlterFooTogether operations don't track what their previous value was, it's impossible to determine whether or not the optimization is safe so the only way to proceed is to disable the optimization. Thanks Ramiro Morales for the in-depth analysis of the issue. Refs #24828
This commit is contained in:
parent
55b6f7af0c
commit
ed7898e1b5
4 changed files with 11 additions and 17 deletions
|
@ -1335,7 +1335,7 @@ class SquashMigrationsTests(MigrationTestBase):
|
|||
out = io.StringIO()
|
||||
with self.temporary_migration_module(module="migrations.test_migrations"):
|
||||
call_command("squashmigrations", "migrations", "0002", interactive=False, verbosity=1, stdout=out)
|
||||
self.assertIn("Optimized from 8 operations to 3 operations.", out.getvalue())
|
||||
self.assertIn("Optimized from 8 operations to 4 operations.", out.getvalue())
|
||||
|
||||
def test_ticket_23799_squashmigrations_no_optimize(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue