-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use 'unique' instead of 'create_unique_index' for m2m field #1903
Conversation
CodSpeed Performance ReportMerging #1903 will not alter performanceComparing Summary
|
unique
instead of 'create_unique_index' for m2m field
Pull Request Test Coverage Report for Build 13615519024Details
💛 - Coveralls |
unique
instead of 'create_unique_index' for m2m field**kwargs: Any, | ||
) -> None: | ||
# TODO: rename through to through_table | ||
# TODO: add through to use a Model | ||
super().__init__(field_type, **kwargs) | ||
super().__init__(field_type, unique=unique, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to pass unique explicitly here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because ManyToManyFieldInstance inherit from class Field
, which receive the unique
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Although we should also update CHANGELOG, however, we can do it when doing a release.
Description
Related issue: tortoise/aerich#406