-
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
Custom foreign key name #3326
Custom foreign key name #3326
Conversation
@@ -29,7 +29,7 @@ export class AddressRepository extends DefaultCrudRepository< | |||
customerRepositoryGetter: Getter<CustomerRepository>, | |||
) { | |||
super(Address, db); | |||
this.customer = this._createBelongsToAccessorFor( | |||
this.customer = this.createBelongsToAccessorFor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of this change, there's no longer coverage for _createBelongsToAccesorFor
: https://coveralls.io/builds/24455533/source?filename=packages/repository/src/repositories/legacy-juggler-bridge.ts#L259. Should I revert it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's deprecated, so not sure what the best course of action should be. For now, we could duplicate the tests for coverage of both until we remove it. @bajtos thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted it so the function is still covered, but I can open another PR if we want to change it to the non-deprecated version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 💯 . Please get one more approval before landing.
c843223
to
89acaed
Compare
Closes #2169.
keyTo
actually exists in the target model{ModelName}Id
work e.g. with underscores or a completely different name) for the foreign key also work.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈