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 over multiple columns #1

Open
castamir opened this issue Mar 25, 2014 · 5 comments
Open

Unique over multiple columns #1

castamir opened this issue Mar 25, 2014 · 5 comments

Comments

@castamir
Copy link

What about UNIQUE resource, tag?

@jasir
Copy link
Owner

jasir commented Mar 26, 2014

What you mean by that?

@castamir
Copy link
Author

Let's have the following schema where the relation table user_role has a combined unique key from columns user and role (e.g. in mysql: UNIQUE KEY user_role (user,role)).
schema

I definitely don't want to have a role assigned multiple times to a given user (e.g. user Franta is 5x admin).

@jasir
Copy link
Owner

jasir commented Mar 28, 2014

Můžeme česky?
Jak by sis představoval tu syntaxi? Klidně připrav pull, já na to teď bohužel vůbec nemám čas.

@castamir
Copy link
Author

Asi nějakou speciální phpdoc anotací např. @contraints unique(user, role)

@contraints by mohlo obsahovat všechny podobné omezení... pokud se jich ale víc nenajde, tak asi bude lepší udělat prostě @unique user, role

@jasir
Copy link
Owner

jasir commented Mar 28, 2014

Hmm, ty anotace na entitě (ne na property) by se určitě hodily... Zakládal jsem nějaký bug i na leanmapperu, ale také to nemám úplně ujasněné. Tenhle generátor to chceš zvládne v okamžiku, kdy ta vazební tabulka bude také entita.

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