-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(repository): revert hasOne target FK as PK implementation #2147
Conversation
caa876b
to
cb55408
Compare
6d53e9d
to
3b3975f
Compare
Remove attempt at guaranteeing the foreign key of a has one relation to be unique by using it as the primary key of the target model. This allow users to set up their own unique contstraints.
3b3975f
to
37ef168
Compare
Hello @b-admike, |
Actually the changes do not guarantee uniqueness of the relation in any way, it is up to our users to set up the underlying database to be used instead of LoopBack doing so since we couldn't find a generic approach for it and need to investigate how to deliver a robust solution. You can find more info at #1718 (comment) and #2161. |
But what about in-memory? In this case the is no DB... |
Hello, |
@RaphaelDrai Good catch! I think those two operations should have been implemented as part of #1422 but somehow that task slipped out. Please create a new GitHub issue for this missing feature. I am going to lock this pull request to collaborators only, please open new issues for any new discussions. |
Remove attempt at guaranteeing the foreign key of a has one relation to be unique by using it
as the primary key of the target model. This allow users to set up their own unique contstraints. @RaphaelDrai FYI (what I mentioned in #2005 (comment))
Motivation:
TODO: docs for the
hasOne
relation (most likely in another PR, so we can do a release).Checklist
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated