loopback-next
loopback-next copied to clipboard
feat: support non-primary reference keys of source and target model for hasManyThrough relation
This PR will provide support for non-primary key references of source & target models in case of hasManyThrough relation.
Checklist
- [x] DCO (Developer Certificate of Origin) signed in all commits
- [x]
npm test
passes on your machine - [x] New tests added or existing tests modified to cover all changes
- [x] Code conforms with the style guide
- [ ] API Documentation in code was updated
- [x] Documentation in /docs/site was updated
- [x] Affected artifact templates in
packages/cli
were updated - [ ] Affected example projects in
examples/*
were updated
Pull Request Test Coverage Report for Build 7687463955
- -4 of 4 (0.0%) changed or added relevant lines in 1 file are covered.
- 1 unchanged line in 1 file lost coverage.
- Overall coverage decreased (-0.03%) to 55.344%
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
---|---|---|---|
packages/repository/src/relations/has-many/has-many-through.helpers.ts | 0 | 4 | 0.0% |
<!-- | Total: | 0 | 4 |
Files with Coverage Reduction | New Missed Lines | % |
---|---|---|
packages/repository/src/relations/has-many/has-many-through.helpers.ts | 1 | 7.59% |
<!-- | Total: | 1 |
Totals | |
---|---|
Change from base Build 7663796800: | -0.03% |
Covered Lines: | 9563 |
Relevant Lines: | 12459 |
💛 - Coveralls
Hi, @samarpanB. Can you please have look at this PR?
Can you share an example where this might be useful ? I believe hasManyThrough need to be mostly with primary keys only.
@samarpanB. We can create hasManyThrough (or any other relation) with a unique key - which can be a non-primary key.