From 44281bc2123dac1b127000c84c759f9678021826 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Sat, 16 Nov 2024 10:02:11 -0500 Subject: [PATCH] Refs #27236 -- Removed references to index_together from ModelState.from_model. It's not possible for ModelMeta.index_together to exist anymore. --- django/db/migrations/state.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py index f3b70196db..f803e8a709 100644 --- a/django/db/migrations/state.py +++ b/django/db/migrations/state.py @@ -827,9 +827,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: @@ -845,7 +842,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.