You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checking the api explorer, there is a duplicate primary key in the schema. Why is this happening?
I have to manually change the threadid field to ThreadID to solve this issue.
Hey @daddybh , I tried to reproduce your problem but in my case, the primary key works fine.
I will paste my snippet and config stuff here, if you still have problem, please contact me and I ll see should we move to google group to discuss it or reopen this issue for features/bugs. Thanks for your understanding.
This is my script file, exactly the same code as you post:
And in the model.json file, the primary key ThreadID from mysql is mapped as threadid in loopback. You can test it by inserting two instances with same threadid, which would fail due to duplicate entry(error ER_DUP_ENTRY)
Activity
[-]duplicate primary key in model.[/-][+]duplicate primary key in api explorer[/+]jannyHou commentedon Nov 23, 2015
Hey @daddybh , I tried to reproduce your problem but in my case, the primary key works fine.
I will paste my snippet and config stuff here, if you still have problem, please contact me and I ll see should we move to google group to discuss it or reopen this issue for features/bugs. Thanks for your understanding.
This is my script file, exactly the same code as you post:
And I created the table in MySQL as :
My explore api looks like:
(please ignore unnecessary property names :p)
And in the
model.jsonfile, the primary keyThreadIDfrom mysql is mapped asthreadidin loopback. You can test it by inserting two instances with same threadid, which would fail due to duplicate entry(errorER_DUP_ENTRY)