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

Automatically add clean functionality for partially unique index constraints? #129

Open
sjamaan opened this issue Apr 9, 2020 · 0 comments

Comments

@sjamaan
Copy link
Contributor

sjamaan commented Apr 9, 2020

Django has no validation for unique indexes (see this part of the Django code). As far as I can tell, you can pretty easily query partially unique fields just as easily as you can query fully unique(_together) fields.

For projects we've been using our own hacked version of the django-partial-index plugin, which provides a mixin that adds validations for these kind of partial indexes. We could migrate away from this plugin and use standard Django indexes with conditions, if Binder model would extend full_clean to check partial indexes as well.

Also: Maybe make a PR for Django for this so in the long run we can drop this again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant