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

Support multiple-field unique constraints #267

Closed
xakep666 opened this issue May 8, 2018 · 1 comment
Closed

Support multiple-field unique constraints #267

xakep666 opened this issue May 8, 2018 · 1 comment

Comments

@xakep666
Copy link

xakep666 commented May 8, 2018

Hi there, I found your ORM great and want to use it.

But for usage I need support for unique constraints generation for multiple fields. https://github.com/go-pg/pg has this feature: it looks like

type Translation struct {
	Id     int
	BookId int    `sql:"unique:book_id_lang"`
	Book   *Book  // has one relation
	Lang   string `sql:"unique:book_id_lang"`
}

So I`m wondering if there is any plans for this feature?

@xakep666 xakep666 changed the title Support unique constraint for multiple fields Support multiple-field unique constraints May 8, 2018
@roobre
Copy link
Contributor

roobre commented May 23, 2018

Support for user-defined indices via struct tags is kind of planned in #243, but due to lack of time I feel like those are not arriving anytime soon.

PRs are welcome, though.

@roobre roobre closed this as completed May 28, 2018
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