From b1e7d19d4c7015efe0c65361bb7f00a2f1c7047c Mon Sep 17 00:00:00 2001 From: Akshesh Date: Thu, 7 Jul 2016 12:00:55 +0530 Subject: Refs #26709 -- Required a name for Indexes passed to AddIndex. Thanks to Markush for discussions. --- django/db/migrations/operations/models.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'django') diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py index 4c9467cc0d..888b2851da 100644 --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -751,6 +751,11 @@ class AddIndex(Operation): def __init__(self, model_name, index): self.model_name = model_name + if not index._name: + raise ValueError( + "Indexes passed to AddIndex operations require a name " + "argument. %r doesn't have one." % index + ) self.index = index def state_forwards(self, app_label, state): -- cgit v1.3