You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However in some cases you might want more explicit relationships like:
hasExactlyOne = always has 1 child
hasAtLeastOne = has 1 or many children
belongsToAtLeastOne = belongs to 1 or many parents
I can imagine in some cases there are even more complex enforcements, like having exactly X relations.
Bookshelf doesn't provide any of this behaviour, but bookshelf relations has the ability, I think, to enforce this kind of rule and abstract away the logic.
In Ghost we already have a use case for hasAtLeastOne with authors and potentially a case for hasExactlyOne for dividing the post table up behind the scenes to improve performance.
We maybe should add a way to configure these extra constraints in bookshelf-relations somehow?
The text was updated successfully, but these errors were encountered:
Normally:
However in some cases you might want more explicit relationships like:
I can imagine in some cases there are even more complex enforcements, like having exactly X relations.
Bookshelf doesn't provide any of this behaviour, but bookshelf relations has the ability, I think, to enforce this kind of rule and abstract away the logic.
In Ghost we already have a use case for hasAtLeastOne with authors and potentially a case for hasExactlyOne for dividing the post table up behind the scenes to improve performance.
We maybe should add a way to configure these extra constraints in bookshelf-relations somehow?
The text was updated successfully, but these errors were encountered: