Skip to content
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

Update unique_together by UniqueConstraint #1892

Merged

Conversation

falvaradorodriguez
Copy link
Contributor

Closes #1890

@falvaradorodriguez falvaradorodriguez marked this pull request as ready for review February 27, 2024 16:19
@falvaradorodriguez falvaradorodriguez requested a review from a team as a code owner February 27, 2024 16:19
unique_together = (("ethereum_tx", "log_index"),)
constraints = [
models.UniqueConstraint(
fields=["ethereum_tx", "log_index"], name="unique_token_transfer_index"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work if you don't set name? I would prefer to use the default django naming if posible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the name parameter is mandatory:
Screenshot 2024-02-27 at 17 36 26

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Felipe! Makes sense then. I don't understand why they set an optional field for mandatory argument, but... 🤷🏻

@falvaradorodriguez falvaradorodriguez merged commit e92bbd0 into master Feb 28, 2024
6 checks passed
@falvaradorodriguez falvaradorodriguez deleted the replace-unique-together-by-unique-constraint branch February 28, 2024 07:46
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace unique_together by UniqueConstraint
2 participants