-
Notifications
You must be signed in to change notification settings - Fork 181
Fix bug cannot create foreign key #371
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
Conversation
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
Thank you for the contribution! Please sign the CLA The change looks good, but I think you need to update the tests as well |
Thank you @elv1s |
Thanks @danghung-dev, it looks like the cla check is still failing. Did you sign the loopback-connector-postgres cla? It is different from the loopback cla |
@slnode test please |
@rmg, could you please help? Looks like @danghung-dev has signed the CLA but it's not showing the right status? Thanks! |
This pull request includes a commit attributed to @smartlogvn, so they will also need to sign the CLA. |
Thanks @rmg |
@slnode test please |
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
There is one test case failing:
Since it's only failing for Node.js 8, let me kick off CI again to make sure. |
@slnode test please |
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.
@danghung-dev Thank you for taking the investigation! I am glad you figured out the fix.
I left a comment about the test change.
@@ -477,6 +477,9 @@ describe('autoupdate', function() { | |||
'customerId': { | |||
'type': 'String', | |||
'length': 20, | |||
'postgresql': { |
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.
If the columnName is the same as property name, why do we have to specify it again here?
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.
We have to do that, if we don't the column name will be convert to lowercase.
Please take a look at this issue. #38
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 see thanks for pointing to the issue.
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.
@danghung-dev Thank you for your contribution! LGTM 🚢
3.6.1 * Fix cannot create foreignkey (loopbackio#371) (Hung) * Add regression test (jlawrencecfm) * Use canonical index name when dropping (jlawrencecfm) * add @elv1s as CODEOWNERS (Diana Lau)
Description
If the foreign key is lower case, it can be created. But if it has any character uppercase. I cannot create.
I fix it by simple modify
this.escapeName(fk.foreignKey)
Related issues
Checklist
guide