mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #34366 -- Reduced AlterField operations when optimizing migrations.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f9fe062de5
commit
2276ec8c21
@@ -247,9 +247,9 @@ class AlterField(FieldOperation):
|
||||
return "alter_%s_%s" % (self.model_name_lower, self.name_lower)
|
||||
|
||||
def reduce(self, operation, app_label):
|
||||
if isinstance(operation, RemoveField) and self.is_same_field_operation(
|
||||
operation
|
||||
):
|
||||
if isinstance(
|
||||
operation, (AlterField, RemoveField)
|
||||
) and self.is_same_field_operation(operation):
|
||||
return [operation]
|
||||
elif (
|
||||
isinstance(operation, RenameField)
|
||||
|
||||
Reference in New Issue
Block a user