-
Notifications
You must be signed in to change notification settings - Fork 79
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
idInjection not working #1
Comments
We need more information to understand your issue:
|
I followed the example and put By the way when I ran the tests I was getting a PK id created for the CUSTOMER_TEST TABLE |
For the customer_test model, it has the PK definition as follows: "properties": {
"id": {
"type": "String",
"length": 20,
"id": 1 // This is the 1st field in the PK
}, You can change the PK field name, for example: "properties": {
"customerId": {
"type": "String",
"length": 20,
"id": 1
}, |
For the customer_test model the id field is created as an int instead of varchar. Yes, I could change my field name from id to another name as a workaround and I can ignore the id field generated. But is the idInjection option supposed to work? |
Basically I don't want the database generate the id field for me. |
To clarify:
{"myId": {"type": "string", "id": true}}
|
Thanks for clarification. |
I can't set a model id manually even after setting idInjection to false. |
@idosh Can you provide a test case to reproduce the problem? A link to your github repo is ideal. |
I'm working on a closed source project so I can't link my repo here.
As you can see, I'm defining a model without id injection but still my id field is ignored.
|
Add support for idInjection Closes loopbackio#1
I believe this problem this exists. My schema:
Running
|
Hi, I am also facing the same issue. below is my schema. {
}, when I am checking my model in browser it looks like : { "id": 0 filed is getting added automatically. I do not want this id field to be added. Please let me know the solution. |
Got the same problem. |
For anyone who has an id getting added even after setting
|
I set idInjection option to false and the mssql still creates an id PK field.
The text was updated successfully, but these errors were encountered: