hi,
i would like to know if i can use isUnique on a relation ? and how plz?
d
dankent
09/10/2017, 7:25 PM
If you use a 1-n or 1-1 relationship, the ID at one (1-n) or both (1-1) ends of the relationship will have to be unique. Using that ID in another relationship will automatically break the existing relationship.
n
notrab
09/10/2017, 8:03 PM
I've not seen this for one to many before. It would be awesome if like ActiveRecord there were scopes for uniqueness.
b
Boris Henné
09/10/2017, 11:04 PM
Ok ty i gonna see more my data models
d
dankent
09/11/2017, 8:10 AM
@notrab if I have a 1-n relationship between User and Post, each Post ID can only be in the relationship once. Adding a post to another User will remove it from its current User