diff options
| author | Simon Charette <charette.s@gmail.com> | 2024-11-16 10:02:11 -0500 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-12-17 10:01:14 +0100 |
| commit | 85c3550106b6a5b2d08e09f338553df0dfe54e4a (patch) | |
| tree | e57126d31f713914ecc4b041cb7f058b1bb82ea8 | |
| parent | 6f42b675c7e2f209b918a3394922af8d0401a016 (diff) | |
[5.1.x] Refs #27236 -- Removed references to index_together from ModelState.from_model.
It's not possible for ModelMeta.index_together to exist anymore.
Backport of 44281bc2123dac1b127000c84c759f9678021826 from main.
| -rw-r--r-- | django/db/migrations/state.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py index 42a2c80a5e..2a9522e79a 100644 --- a/django/db/migrations/state.py +++ b/django/db/migrations/state.py @@ -811,9 +811,6 @@ class ModelState: if name == "unique_together": ut = model._meta.original_attrs["unique_together"] options[name] = set(normalize_together(ut)) - elif name == "index_together": - it = model._meta.original_attrs["index_together"] - options[name] = set(normalize_together(it)) elif name == "indexes": indexes = [idx.clone() for idx in model._meta.indexes] for index in indexes: @@ -829,7 +826,7 @@ class ModelState: # If we're ignoring relationships, remove all field-listing model # options (that option basically just means "make a stub model") if exclude_rels: - for key in ["unique_together", "index_together", "order_with_respect_to"]: + for key in ["unique_together", "order_with_respect_to"]: if key in options: del options[key] # Private fields are ignored, so remove options that refer to them. |
