mirror of
https://github.com/django/django.git
synced 2025-09-17 16:05:54 +00:00
Refs #26709 -- Required a name for Indexes passed to AddIndex.
Thanks to Markush for discussions.
This commit is contained in:
parent
f1af076fba
commit
b1e7d19d4c
3 changed files with 14 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue