Generator does not use defined ID column
Generator does not use defined ID column
We had a new started use the data tables generator to learn how it worked. We were using node.js with a mysql database. The database table has a primary key with the name 'pkid'. This was defined to the Generator.
When we launched the generated app it fell over with a SQL error because it tried to retrieve the column called 'id'. This was not found, obviously. We could not see where this column is used, but we suspect it is in some of the funky code that does the database interaction.
When we renamed the column in our database from 'pkid' to 'id', everything worked as expected.
Replies
Hi,
Thanks for letting me know about this. What server-side package were you using? Is it NodeJS you are using? I've just tried it, and it looks like it is working correctly for all but NodeJS.
I've just fixed the NodeJS package build (the
new Editor()
constructor in the controller needs a third parameter which contains the primary key id.Regards,
Allan
Hi Allan,
yes, it was Node.js. Thanks for the fix.
Adrian