Generator does not use defined ID column

Generator does not use defined ID column

Adrian ChallinorAdrian Challinor Posts: 21Questions: 8Answers: 0

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

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    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

  • Adrian ChallinorAdrian Challinor Posts: 21Questions: 8Answers: 0

    Hi Allan,

    yes, it was Node.js. Thanks for the fix.

    Adrian

Sign In or Register to comment.