-
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
Migration guide for model relations #4058
Conversation
1e71e11
to
9c0f712
Compare
The pull request is ready for review, @raymondfeng @strongloop/loopback-maintainers PTAL. I found two more errors I'd like to fix outside of this PR, they are not blocking the guide.
|
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.
LGTM 👍 , just some nitpicks
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.
Great stuff
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.
A few nitpicks : ) LGTM
[Migrating model definitions and built-in APIs](./core.md), especially | ||
creation of Repository classes for models on both sides of the relation. | ||
|
||
2. Run `lb4 relation` to define the model relation in your model class, generate |
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.
Maybe make it more clear like:
Run `lb4 relation` to create the model relations according to the relation definitions defined in lb3 model json files.
so that people understand where to find the relation definitions.
And we can link to the generator doc as well: https://loopback.io/doc/en/lb4/Relation-generator.html
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.
according to the relation definitions defined in lb3 model json files.
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.
according to the relation definitions defined in lb3 model json files.
I am concerned that this is not entirely correct. Relations can be defined from JS code too, e.g. Product.belongsTo(Category)
.
I am not sure how to best incorporate this information into the migration guide. Let's leave it out of scope of this pull request. If you have some ideas how to improve the current text, then can you please open a follow-up pull request yourself?
And we can link to the generator doc as well: https://loopback.io/doc/en/lb4/Relation-generator.html
Great idea 👍
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.
👍
Signed-off-by: Miroslav Bajtoš <[email protected]>
Signed-off-by: Miroslav Bajtoš <[email protected]>
9c0f712
to
12179b5
Compare
Describe how to migrate model relations from LB3 to LB4.
Fix #3948
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 👈