Kaydet (Commit) 11c02133 authored tarafından Andrew Godwin's avatar Andrew Godwin

Fixed #21958: Handle dependencies for swappable models in AddField

üst 42607a9e
......@@ -233,6 +233,9 @@ class MigrationAutodetector(object):
field=field,
)
)
swappable_setting = new_apps.get_model(app_label, model_name)._meta.get_field_by_name(field_name)[0].swappable_setting
if swappable_setting is not None:
self.add_swappable_dependency(app_label, swappable_setting)
# Old fields
for app_label, model_name, field_name in old_fields - new_fields:
old_model_state = self.from_state.models[app_label, model_name]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment