Proper unique index name when using db_field.
This commit is contained in:
parent
9540555b26
commit
dcc8d22cec
@ -269,7 +269,7 @@ class TopLevelDocumentMetaclass(DocumentMetaclass):
|
|||||||
# Generate a list of indexes needed by uniqueness constraints
|
# Generate a list of indexes needed by uniqueness constraints
|
||||||
if field.unique:
|
if field.unique:
|
||||||
field.required = True
|
field.required = True
|
||||||
unique_fields = [field_name]
|
unique_fields = [field.db_field]
|
||||||
|
|
||||||
# Add any unique_with fields to the back of the index spec
|
# Add any unique_with fields to the back of the index spec
|
||||||
if field.unique_with:
|
if field.unique_with:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user