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

Unique Together #241

Open
shattl opened this issue Oct 14, 2022 · 1 comment
Open

Unique Together #241

shattl opened this issue Oct 14, 2022 · 1 comment

Comments

@shattl
Copy link

shattl commented Oct 14, 2022

Hi! Thanks for the last update! While building our app we faced one more lack of functionality in the ORM

Do you have plans to implement "unique together" feature (for two or more fields)? Even sqlite supports it, very useful thing

The same in django, https://stackoverflow.com/questions/2201598/how-to-define-two-fields-unique-as-couple

@dantownsend
Copy link
Member

@shattl You're right, this needs adding.

There's a PR for it currently - piccolo-orm/piccolo#582, which is quite close to be being done.

So hopefully it won't be too long.

In the mean time, you can get around it using a migration with raw SQL for adding / deleting the unique together constraints.

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

2 participants